FScrollyZoomy

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

Windows
MacOS
Linux

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Framework/Layout/ScrollyZoomy.h

Include

#include "Framework/Layout/ScrollyZoomy.h"

Syntax

class FScrollyZoomy

Remarks

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.

Constructors

Name Description

Public function

FScrollyZoomy

(
    const bool InUseInertialScrolling
)

Create and initialize a new instance.

Functions

Name Description

Public function Const

const FVecto...

 

GetSoftwareCursorPosition()

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

Public function Const

bool

 

IsRightClickScrolling()

Whether the user is actively scrolling.

Public function Const

bool

 

NeedsSoftwareCursor()

Whether a software cursor should be rendered.

Public function Const

FCursorReply

 

OnCursorQuery()

Call this from your widget's OnCursorQuery function.

Public function

FReply

 

OnMouseButtonDown

(
    const FPointerEvent& MouseEvent
)

Should be called when a mouse button is pressed.

Public function

FReply

 

OnMouseButtonUp

(
    const TSharedRef< SWidget > MyWidge...,
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Should be called when a mouse button is released.

Public function

void

 

OnMouseLeave

(
    const TSharedRef< SWidget > MyWidge...,
    const FPointerEvent& MouseEvent
)

Should be called from your widget's OnMouseLeave override.

Public function

FReply

 

OnMouseMove

(
    const TSharedRef< SWidget > MyWidge...,
    IScrollableZoomable& ScrollableZoo...,
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Should be called when a mouse move event occurs.

Public function

FReply

 

OnMouseWheel

(
    const FPointerEvent& MouseEvent,
    IScrollableZoomable& ScrollableZoo...
)

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

Public function Const

int32

 

PaintSoftwareCursorIfNeeded

(
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId
)

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

Public function

void

 

Tick

(
    const float DeltaTime,
    IScrollableZoomable& ScrollableZoo...
)

Should be called every frame to update simulation state.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss