class
GUIScrollBar
GUI element representing an element with a draggable handle of a variable size.
Public
Methods
SetScrollHandlePosition
Position of the scroll handle in percent (ranging [0, 1]).
GetScrollHandlePosition
SetScrollHandleSize
Size of the scroll handle in percent (ranging [0, 1]) of the total scroll bar area.
GetScrollHandleSize
Scroll
Moves the handle by some amount.
Amount is specified in the percentage of the entire scrollable area. Values out of range will be clamped.
GetScrollableSize
Returns the maximum scrollable size the handle can move within (for example scroll bar length).
IsInInteractionBounds
Checks is the specified position within interactable bounds of a GUI element.
These are the bounds that will be used for hit tests for e.g. mouse cursor. By default this is the same as the absolute clipped bounds of the GUI element. Position is relative to parent GUI widget.
Fields
OnScrollOrResize
Triggered whenever the scrollbar handle is moved or resized.
Values provided are the handle position and size in percent (ranging [0, 1]).
Internal
Methods
GetStyleSheetElement
Returns the name of the GUI element type to be used for style lookup in the style sheet.
SetHandleSizeInternal
Sets the size of the handle in percent (ranging [0, 1]) of the total scroll bar area.
SetScrollPosInternal
Sets the position of the scroll handle in percent (ranging [0, 1]).
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
UpdateLayoutForChildren
Calculates sizes and relative positions for all child elements.
Should be preceded with a call to UpdateOptimalLayoutSizes().
Protected
Constructors
GUIScrollBar
Constructs a new scrollbar.
- horizontal
- If true the scroll bar will have a horizontal moving handle, otherwise it will be a vertical one.
- resizable
- If true the scrollbar will have additional handles that allow the scroll handle to be resized. This allows you to adjust the size of the visible scroll area.
- styleName
- Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default style is used.
- dimensions
- Determines valid dimensions (size) of the element.
Methods
~GUIScrollBar
UpdateRenderElements
Recreates the internal render elements.
Must be called before GetRenderElementVertexAndIndexData/FillBuffer if element is dirty. Marks the element as non dirty.
GetRenderElementDepthRange
Returns the range of depths that the child elements can be rendered it.
Private
Methods
HandleMoved
Triggered whenever the scroll handle moves.
Provided value represents the new position and size of the handle in percent (ranging [0, 1]).
UpButtonClicked
Triggered when scroll up button is clicked.
DownButtonClicked
Triggered when scroll down button is clicked.