![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <InertialScrollManager.h>
Public Member Functions | |
| SLATE_API | FInertialScrollManager (double SampleTimeout=0.1f) |
| SLATE_API void | AddScrollSample (float Delta, double CurrentTime) |
| SLATE_API void | UpdateScrollVelocity (const float InDeltaTime) |
| SLATE_API void | ClearScrollVelocity (bool bInShouldStopScrollNow=false) |
| float | GetScrollVelocity () const |
| bool | GetShouldStopScrollNow () const |
| void | ResetShouldStopScrollNow () |
A helper class to calculate inertial scrolling. This class combines a percentage of velocity lost per second coupled with a static amount of velocity lost per second in order to achieve a quick decay when the velocity grows small enough, and the percentage of friction lost prevents large velocities from scrolling forever.
| FInertialScrollManager::FInertialScrollManager | ( | double | SampleTimeout = 0.1f | ) |
Constructor
| ScrollDecceleration | The acceleration against the velocity causing it to decay. |
| SampleTimeout | Samples older than this amount of time will be discarded. |
Adds a scroll velocity sample to help calculate a smooth velocity
Stop the accumulation of inertial scroll.
| bInShouldStopScrollNow | true implies the scroll will stop instantly, else the list will scroll until any accumulated scroll offset is cleared. |
|
inline |
Gets the calculated velocity of the scroll.
|
inline |
Gets the the value of bShouldStopScrollNow.
|
inline |
Set the value of bShouldStopScrollNow to false.
Updates the current scroll velocity. Call every frame.