ScummVM API documentation
GUI::FluidScroller Class Reference

Public Member Functions

void setBounds (float maxScroll, int viewportHeight, float stepSize)
 
void reset ()
 
void stopAnimation ()
 
void feedDrag (uint32 time, int deltaY)
 
void startFling ()
 
void startFling (float velocity)
 
void feedWheel (uint32 time, float deltaY)
 
void handleMouseWheel (int direction, float multiplier=1.0f)
 
bool isAnimating () const
 
bool update (uint32 time, float &outVisualPos)
 
float setPosition (float pos, bool checkBound=false)
 
float getVisualPosition () const
 
void checkBoundaries ()
 

Member Function Documentation

◆ setBounds()

void GUI::FluidScroller::setBounds ( float  maxScroll,
int  viewportHeight,
float  stepSize 
)

Configure the constraints for the content

Parameters
maxScrollThe maximum scrollable distance (total height - viewport height)
viewportHeightThe height of the scrolling area, used for rubber-band range
stepSizeDefault scroll step (usually _singleStep)

◆ feedDrag()

void GUI::FluidScroller::feedDrag ( uint32  time,
int  deltaY 
)

Record a pointer movement and update the raw position

Parameters
timeCurrent system time in ms
deltaYThe movement since the last frame

◆ handleMouseWheel()

void GUI::FluidScroller::handleMouseWheel ( int  direction,
float  multiplier = 1.0f 
)

Handle mouse wheel input

Parameters
directionScroll direction
multiplierSpeed multiplier for the scroll

◆ update()

bool GUI::FluidScroller::update ( uint32  time,
float &  outVisualPos 
)

Update the internal animation state

Parameters
timeCurrent system time in ms
outVisualPosThe resulting visual scroll position (including rubber-banding)
Returns
True if an animation is active and updated

The documentation for this class was generated from the following file: