ScrollController

Describe interface for scrollable widgets, this controller computes content offsets and scroll button size and offset depending of the contentSize and and visibleSize. See how to use this controller in rpui.widgets.panel.Panel.

Constructors

this
this(Orientation orientation)

Create controller with orientation - vertical or horizontal.

Members

Functions

addOffsetInPx
bool addOffsetInPx(float delta)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseDown
void onMouseDown(MouseDownEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
onResize
void onResize()

Update parameters when widget update size.

pollButton
void pollButton(vec2i mousePos, vec2i mouseClickPos)

Calculates buttonSize, buttonOffset and contentOffset.

setOffsetInPercent
void setOffsetInPercent(float percent)

Set content offset in percent, value should be in 0..1 range.

setOffsetInPx
bool setOffsetInPx(float pixels)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

buttonOffset
float buttonOffset [@property getter]

Calculated button offset.

buttonSize
float buttonSize [@property getter]

Calculated button size.

contentOffset
float contentOffset [@property getter]

Calculated content offset.

Variables

buttonClick
bool buttonClick;

If true, then user clicked button and hold it.

buttonMaxOffset
float buttonMaxOffset;
Undocumented in source.
buttonMaxSize
float buttonMaxSize;
Undocumented in source.
buttonMinSize
float buttonMinSize;
Undocumented in source.
contentMaxOffset
float contentMaxOffset;
Undocumented in source.
contentSize
float contentSize;

Full content size.

visibleSize
float visibleSize;

Visible area size.

Meta