class
GUIScrollArea
A GUI element container with support for vertical
& horizontal scrolling.
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
~GUIScrollArea
GetLayout
Returns the scroll area layout that you may use to add elements inside the scroll area.
ScrollUp
Scrolls the area up by specified amount of pixels, if possible.
ScrollDown
Scrolls the area down by specified amount of pixels, if possible.
ScrollLeft
Scrolls the area left by specified amount of pixels, if possible.
ScrollRight
Scrolls the area right by specified amount of pixels, if possible.
ScrollUp
Scrolls the area up by specified percentage (ranging [0, 1]), if possible.
ScrollDown
Scrolls the area down by specified percentage (ranging [0, 1]), if possible.
ScrollLeft
Scrolls the area left by specified percentage (ranging [0, 1]), if possible.
ScrollRight
Scrolls the area right by specified percentage (ranging [0, 1]), if possible.
ScrollToVertical
Scrolls the contents to the specified position (0 meaning top-most part of the content is visible, and 1 meaning bottom-most part is visible).
ScrollToHorizontal
Scrolls the contents to the specified position (0 meaning left-most part of the content is visible, and 1 meaning right-most part is visible)
GetVerticalScroll
Returns how much is the scroll area scrolled in the vertical direction.
Returned value represents percentage where 0 means no scrolling is happening, and 1 means area is fully scrolled to the bottom.
GetHorizontalScroll
Returns how much is the scroll area scrolled in the horizontal direction.
Returned value represents percentage where 0 means no scrolling is happening, and 1 means area is fully scrolled to the right.
GetContentBounds
Returns the bounds of the scroll area not including the scroll bars (meaning only the portion that contains the contents).
SetEnableCulling
Enables/disables culling of child elements.
If culling is enabled all child elements that are fully outside of the parent visible bounds will be marked as culled. Culled elements will never have their contents or mesh updated, their absolute coordinate will not be updated and they wont be drawn This is useful for layouts with a large amount of children, but comes with an overhead so it is disabled by default. Note this has no impact on layout update, which may still be expensive with many elements.
GetScrollBarSize
Returns the width or height of the scrollbar.
staticGetRttiStatic
staticCreate
Creates a new GUI element.
- contents
- Structure describing the contents of the GUI element to create.
- styleClass
- Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.
- options
- Additional options that control GUI element size and position. This will override options set in the style sheet.
Internal
Constructors
GUIScrollArea
Protected
Methods
GetConstrainedSizeRange
Returns element size constrained by its size constraints.
This is different from CalculateConstrainedSize() because this method may return cached size.
CalculateConstrainedSizeRange
Calculates element size based on its optimal size constrained by its size constraint options.
UpdateOptimalLayoutSizes
Calculates optimal sizes of all child elements, as determined by their style and layout options.
This is performed recursively over all child elements, starting with the bottom-most child element. This should be called before UpdateLayoutRecursive().
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
Private
Methods
DoOnMouseEvent
Called when a mouse event is received on any GUI element the mouse is interacting with.
Return true if you have processed the event and don't want other elements to process it.
DoOnVerticalScrollUpdate
Called when the vertical scrollbar moves.
- scrollHandlePosition
- Scrollbar position ranging [0, 1].
DoOnHorizontalScrollUpdate
Called when the horizontal scrollbar moves.
- scrollHandlePosition
- Scrollbar position ranging [0, 1].
UpdateLayoutForChildren
Calculates sizes and relative positions for all child elements.
Should be preceded with a call to UpdateOptimalLayoutSizes().
UpdateAbsoluteCoordinatesForChildren
Calls UpdateAbsoluteCoordinates() on all child elements.
CalculateRelativeElementAreas
Calculates the position and size of the scroll area child layout and the scroll bars.