Navigation
API > API/Runtime > API/Runtime/Slate
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.
| Name | FScrollyZoomy |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Framework/Layout/ScrollyZoomy.h |
| Include Path | #include "Framework/Layout/ScrollyZoomy.h" |
Syntax
class FScrollyZoomy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FScrollyZoomy
(
const bool InUseInertialScrolling |
Create and initialize a new instance. | Framework/Layout/ScrollyZoomy.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AmountScrolledWhileRightMouseDown | float | How much we scrolled while the right mouse button has been held. | Framework/Layout/ScrollyZoomy.h | |
| bShowSoftwareCursor | bool | Whether the software cursor should be drawn in the view port. | Framework/Layout/ScrollyZoomy.h | |
| HorizontalIntertia | FInertialScrollManager | Tracks simulation state for horizontal scrolling. | Framework/Layout/ScrollyZoomy.h | |
| SoftwareCursorPosition | FVector2f | The current position of the software cursor. | Framework/Layout/ScrollyZoomy.h | |
| UseInertialScrolling | bool | Whether inertial scrolling is enabled. | Framework/Layout/ScrollyZoomy.h | |
| VerticalIntertia | FInertialScrollManager | Tracks simulation state for vertical scrolling. | Framework/Layout/ScrollyZoomy.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UE::Slate::FDeprecateVector2DResult GetSoftwareCursorPosition () |
Get the position of the software cursor (when NeedsSoftwareCursor is true). | Framework/Layout/ScrollyZoomy.h | |
bool IsRightClickScrolling() |
Whether the user is actively scrolling. | Framework/Layout/ScrollyZoomy.h | |
bool NeedsSoftwareCursor () |
Whether a software cursor should be rendered. | Framework/Layout/ScrollyZoomy.h | |
FCursorReply OnCursorQuery() |
Call this from your widget's OnCursorQuery function. | Framework/Layout/ScrollyZoomy.h | |
FReply OnMouseButtonDown
(
const FPointerEvent& MouseEvent |
Should be called when a mouse button is pressed. | Framework/Layout/ScrollyZoomy.h | |
FReply OnMouseButtonUp
(
const TSharedRef< SWidget > MyWidget, |
Should be called when a mouse button is released. | Framework/Layout/ScrollyZoomy.h | |
void OnMouseLeave
(
const TSharedRef< SWidget > MyWidget, |
Should be called from your widget's OnMouseLeave override. | Framework/Layout/ScrollyZoomy.h | |
FReply OnMouseMove
(
const TSharedRef< SWidget > MyWidget, |
Should be called when a mouse move event occurs. | Framework/Layout/ScrollyZoomy.h | |
FReply OnMouseWheel
(
const FPointerEvent& MouseEvent, |
Should be called by your widget when the mouse wheel is used | Framework/Layout/ScrollyZoomy.h | |
int32 PaintSoftwareCursorIfNeeded
(
const FGeometry& AllottedGeometry, |
Call this from your widget's OnPaint to paint a software cursor, if needed | Framework/Layout/ScrollyZoomy.h | |
void Tick
(
const float DeltaTime, |
Should be called every frame to update simulation state. | Framework/Layout/ScrollyZoomy.h |