engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FScrollyZoomy类 参考

Utility class that adds scrolling and zooming functionality to a widget. 更多...

#include <ScrollyZoomy.h>

Public 成员函数

 FScrollyZoomy (const bool InUseInertialScrolling=true)
 Create and initialize a new instance. 更多...
 
const FVector2D & GetSoftwareCursorPosition () const
 Get the position of the software cursor (when NeedsSoftwareCursor is true). 更多...
 
bool IsRightClickScrolling () const
 Whether the user is actively scrolling. 更多...
 
bool NeedsSoftwareCursor () const
 Whether a software cursor should be rendered. 更多...
 
FCursorReply OnCursorQuery () const
 Call this from your widget's OnCursorQuery function. 更多...
 
FReply OnMouseButtonDown (const FPointerEvent &MouseEvent)
 Should be called when a mouse button is pressed. 更多...
 
FReply OnMouseButtonUp (const TSharedRef< SWidget > MyWidget, const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 Should be called when a mouse button is released. 更多...
 
void OnMouseLeave (const TSharedRef< SWidget > MyWidget, const FPointerEvent &MouseEvent)
 Should be called from your widget's OnMouseLeave override. 更多...
 
FReply OnMouseMove (const TSharedRef< SWidget > MyWidget, IScrollableZoomable &ScrollableZoomable, const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 Should be called when a mouse move event occurs. 更多...
 
FReply OnMouseWheel (const FPointerEvent &MouseEvent, IScrollableZoomable &ScrollableZoomable)
 Should be called by your widget when the mouse wheel is used 更多...
 
int32 PaintSoftwareCursorIfNeeded (const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId) const
 Call this from your widget's OnPaint to paint a software cursor, if needed 更多...
 
void Tick (const float DeltaTime, IScrollableZoomable &ScrollableZoomable)
 Should be called every frame to update simulation state. 更多...
 

详细描述

Utility class that adds scrolling and zooming functionality to a widget.

Derived your widget class from IScrollableZoomable, then embed an instance of FScrollyZoomy as a widget member variable, and call this class's event handlers from your own widget's event handler callbacks.

构造及析构函数说明

◆ FScrollyZoomy()

FScrollyZoomy::FScrollyZoomy ( const bool  InUseInertialScrolling = true)

Create and initialize a new instance.

参数
InUseInertialScrollingWhether inertial scrolling should be used (default = true).

成员函数说明

◆ GetSoftwareCursorPosition()

const FVector2D & FScrollyZoomy::GetSoftwareCursorPosition ( ) const

Get the position of the software cursor (when NeedsSoftwareCursor is true).

This method should be called from your widget's OnPaint function.

返回
Cursor position.
参见
NeedsSoftwareCursor

◆ IsRightClickScrolling()

bool FScrollyZoomy::IsRightClickScrolling ( ) const

Whether the user is actively scrolling.

返回
true if the user is scrolling, false otherwise.

◆ NeedsSoftwareCursor()

bool FScrollyZoomy::NeedsSoftwareCursor ( ) const

Whether a software cursor should be rendered.

This method should be called from your widget's OnPaint function.

返回
true if a software cursor should be rendered, false otherwise.
参见
GetSoftwareCursorPosition

◆ OnCursorQuery()

FCursorReply FScrollyZoomy::OnCursorQuery ( ) const

Call this from your widget's OnCursorQuery function.

返回
The cursor reply to pass back.

◆ OnMouseButtonDown()

FReply FScrollyZoomy::OnMouseButtonDown ( const FPointerEvent &  MouseEvent)

Should be called when a mouse button is pressed.

参数
MouseEventThe mouse event passed to a widget's OnMouseButtonDown function.
返回
If FReply::Handled is returned, that should be passed as the result of the calling function.

◆ OnMouseButtonUp()

FReply FScrollyZoomy::OnMouseButtonUp ( const TSharedRef< SWidget >  MyWidget,
const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)

Should be called when a mouse button is released.

参数
MyWidgetPointer to the widget that owns this object.
MyGeometryGeometry of the widget we're scrolling.
MouseEventThe mouse event passed to a widget's OnMouseButtonUp function.
返回
If FReply::Handled is returned, that should be passed as the result of the calling function.

◆ OnMouseLeave()

void FScrollyZoomy::OnMouseLeave ( const TSharedRef< SWidget >  MyWidget,
const FPointerEvent &  MouseEvent 
)

Should be called from your widget's OnMouseLeave override.

参数
MyWidgetPointer to the widget that owns this object.
MouseEventThe mouse leave event that was passed to the widget's OnMouseLeave function.

◆ OnMouseMove()

FReply FScrollyZoomy::OnMouseMove ( const TSharedRef< SWidget >  MyWidget,
IScrollableZoomable &  ScrollableZoomable,
const FGeometry &  MyGeometry,
const FPointerEvent &  MouseEvent 
)

Should be called when a mouse move event occurs.

参数
MyWidgetPointer to the widget that owns this object.
ScrollableZoomableInterface to the widget to scroll/zoom.
MyGeometryGeometry of the widget we're scrolling.
MouseEventThe mouse event passed to a widget's OnMouseMove function.
返回
If FReply::Handled is returned, that should be passed as the result of the calling function.

◆ OnMouseWheel()

FReply FScrollyZoomy::OnMouseWheel ( const FPointerEvent &  MouseEvent,
IScrollableZoomable &  ScrollableZoomable 
)

Should be called by your widget when the mouse wheel is used

参数
MouseEventThe event passed to your widget's OnMouseWheel function.
ScrollableZoomableInterface to the widget to scroll/zoom.
返回
If FReply::Handled is returned, that should be passed as the result of the calling function.

◆ PaintSoftwareCursorIfNeeded()

int32 FScrollyZoomy::PaintSoftwareCursorIfNeeded ( const FGeometry &  AllottedGeometry,
const FSlateRect &  MyCullingRect,
FSlateWindowElementList &  OutDrawElements,
int32  LayerId 
) const

Call this from your widget's OnPaint to paint a software cursor, if needed

参数
AllottedGeometryWidget geometry passed into OnPaint.
MyCullingRectWidget clipping rect passed into OnPaint.
OutDrawElementsThe draw element list.
LayerIdLayer identifier.
返回
New layer Identifier.

◆ Tick()

void FScrollyZoomy::Tick ( const float  DeltaTime,
IScrollableZoomable &  ScrollableZoomable 
)

Should be called every frame to update simulation state.

参数
DeltaTimeTime that's passed.
ScrollableZoomableInterface to the widget to scroll/zoom.

该类的文档由以下文件生成: