class
GUILayout
Base class for layout GUI element.
Layout element positions and sizes any child elements according to element styles and layout options.
Public
Constructors
GUILayout
GUILayout
Methods
~GUILayout
AddElement
Adds a new element to the layout after all existing elements.
RemoveElement
Removes the specified element from the layout.
RemoveElementAt
Removes a child element at the specified index.
InsertElement
Inserts a GUI element before the element at the specified index.
GetChildCount
Returns the number of children in the layout.
GetChild
Returns a child element at the specified index, or null if the index is not valid.
Clear
Removes all child elements and destroys them.
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.
staticGetRttiStatic
Internal
Methods
GetConstrainedSizeRange
Returns element size constrained by its size constraints.
This is different from CalculateConstrainedSize() because this method may return cached size.
GetChildrenConstrainedSizes
Returns a size ranges for all children that was cached during the last GUIElementBase::_updateOptimalLayoutSizes call.
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
UpdateAbsoluteCoordinates
Updates the absolute coordinates of the GUI element using the currently assigned relative coordinates and the provided .
Also calculates the visible area clip rectangle and marks culled elements if they have no visible area. This should be called after updating the layout (as layout update calculates the needed relative coordinates). This may also be called independently of layout update, which is useful for scroll areas that then do not require a full layout pass to scroll their children.
- parentOrigin
- Absolute origin to add to the relative coordinates, in order to determine the absolute element coordinates.
- parentScale
- Scale of the parent GUI element.
- parentVisibleArea
- Absolute visible (clipped) area though which this element may be seen. This will be used for culling and clipping.
GetVisibleChildren
Returns all children that can be seen through the parent's visible area (i.e. all elements that are not culled or explicitly made invisible).
Note this may return all child elements on GUI elements that do not support culling. Only well defined after layout update.
Protected
Methods
RegisterChildElement
Registers a new child element.
UnregisterChildElement
Unregisters an existing child element.
UpdateAbsoluteCoordinatesForChildren
Calls UpdateAbsoluteCoordinates() on all child elements.