Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Slate/Public/Framework/Layout/InertialScrollManager.h |
Include |
#include "Framework/Layout/InertialScrollManager.h" |
class FInertialScrollManager
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 | Description | |
---|---|---|
|
FInertialScrollManager ( |
Constructor |
Name | Description | ||
---|---|---|---|
|
AddScrollSample ( |
Adds a scroll velocity sample to help calculate a smooth velocity |
|
|
ClearScrollVelocity() |
Instantly end the inertial scroll |
|
|
float |
GetScrollVelocity() |
Gets the calculated velocity of the scroll. |
|
UpdateScrollVelocity ( |
Updates the current scroll velocity. Call every frame. |
Name |
Description |
---|---|
FrictionCoefficient |
This is the percentage of velocity loss per second. |
StaticVelocityDrag |
This is a constant amount of velocity lost per second. |