class
GUIPanel
Represents a GUI panel that you can use for free placement of GUI elements within its bounds.
Public
Constructors
GUIPanel
GUIPanel
Methods
~GUIPanel
SetDepthRange
Changes values that control at which depth is GUI panel and its children rendered.
- depth
- Determines rendering order of the GUI panel. Panels with lower depth will be rendered in front of panels with higher depth. Provided depth is relative to depth of the parent GUI panel (if any).
- depthRangeMinimum
- Minimum range of depths that children of this GUI panel can have. If any panel has depth outside of the range [depth - depthRangeMinimum, depth + depthRangeMaximum] it will be clamped to nearest extreme. Value of -1 means infinite range.
- depthRangeMaximum
- Maximum range of depths that children of this GUI panel can have. If any panel has depth outside of the range [depth - depthRangeMinimum, depth + depthRangeMaximum] it will be clamped to nearest extreme. Value of -1 means infinite range.
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
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
Methods
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().
GetChildRelativeLayoutAreas
Calculates positions & sizes of all elements in the layout.
This method expects a pre-allocated array to store the data in.
- layoutSize
- Size of the parent layout area to position the child elements in.
- outElementPositions
- Array to hold output positions. Must be the same size as the number of child elements.
- outElementSizes
- Array to hold output areas. Must be the same size as the number of child elements.
- elementCount
- Size of the element positions/sizes arrays.
- sizeRanges
- Ranges of possible sizes used for the child elements. Array must be same size as elements array.
CalculateRelativeElementArea
Calculates the size of the provided child within this layout with the provided dimensions.
GetChildConstrainedSizeRange
Calculates an element size range for the provided child of the GUI panel.
Will return cached bounds so make sure to update optimal size ranges before calling.
UpdateLayoutForChildren
Calculates sizes and relative positions for all child elements.
Should be preceded with a call to UpdateOptimalLayoutSizes().
UpdateDepthRangeInternal
Updates the provided depth range by taking into consideration the depth range of the panel.
This depth range should be passed on to child elements of the panel.