Navigation
API > API/Runtime > API/Runtime/Slate
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.
| Name | FInertialScrollManager |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Framework/Layout/InertialScrollManager.h |
| Include Path | #include "Framework/Layout/InertialScrollManager.h" |
Syntax
class FInertialScrollManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FInertialScrollManager
(
double SampleTimeout |
Constructor | Framework/Layout/InertialScrollManager.h |
Structs
| Name | Remarks |
|---|---|
| FScrollSample |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bShouldStopScrollNow | bool | When true, the list will stop scrolling | Framework/Layout/InertialScrollManager.h | |
| SampleTimeout | double | Samples older than this amount of time will be discarded. | Framework/Layout/InertialScrollManager.h | |
| ScrollSamples | TArray< FScrollSample > | Used to calculate the appropriate scroll velocity over the last few frames while inertial scrolling | Framework/Layout/InertialScrollManager.h | |
| ScrollVelocity | float | The current velocity of the scroll | Framework/Layout/InertialScrollManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddScrollSample
(
float Delta, |
Adds a scroll velocity sample to help calculate a smooth velocity | Framework/Layout/InertialScrollManager.h | |
void ClearScrollVelocity
(
bool bInShouldStopScrollNow |
Stop the accumulation of inertial scroll. | Framework/Layout/InertialScrollManager.h | |
float GetScrollVelocity() |
Gets the calculated velocity of the scroll. | Framework/Layout/InertialScrollManager.h | |
bool GetShouldStopScrollNow() |
Gets the the value of bShouldStopScrollNow. | Framework/Layout/InertialScrollManager.h | |
void ResetShouldStopScrollNow() |
Set the value of bShouldStopScrollNow to false. | Framework/Layout/InertialScrollManager.h | |
void UpdateScrollVelocity
(
const float InDeltaTime |
Updates the current scroll velocity. Call every frame. | Framework/Layout/InertialScrollManager.h |