class
GUIRenderable
Represents a GUI element that can be rendered (i.e. has a visual representation).
Renderable element can have a particular style, and provides one or multiple render elements to be drawn.
Public
Constructors
GUIRenderable
GUIRenderable
Methods
~GUIRenderable
GetStyleSheetElement
Returns the name of the GUI element type to be used for style lookup in the style sheet.
GetStyleSheetClass
Returns a user-specified class that will be used for style lookup in the style sheet.
GetStyleSheetId
Returns an user-specific ID will be used for style lookup in the style sheet.
SetStyleSheetClass
Sets new style class to be used by the element.
IsUsingStyleSheets
Returns true if the GUI elements wants to use the new style sheet approach for styling.
ResetSizeConstraints
Resets element size constraints to their initial values dictated by the element's style.
staticGetRttiStatic
Internal
Methods
GetRenderElements
Returns information about all renderable elements in this GUI element, including their mesh, material and general information.
FillBuffer
Fill the pre-allocated vertex, uv and index buffers with the mesh data for the specified render element.
- vertices
- Previously allocated buffer where to store the vertices. Output is expected to match the GUIMeshType as returned by getRenderElements() for the specified element.
- indices
- Previously allocated buffer where to store the indices.
- vertexOffset
- At which vertex should the method start filling the buffer.
- offset
- Offset that should be applied to all output vertex positions.
- indexOffset
- At which index should the method start filling the buffer.
- maxVertexCount
- Total number of vertices the buffers were allocated for. Used only for memory safety.
- maxIndexCount
- Total number of indices the buffers were allocated for. Used only for memory safety.
- renderElementIndex
- Zero-based index of the render element.
GetRenderElementVertexAndIndexData
Retrieves vertex and index data from GUI render element and outputs them to the provided buffers.
GUI render elements must have been previously populated by calling UpdateRenderElements().
- renderElementIndex
- Zero-based index of the render element from which to retrieve the data.
- vertexOffset
- At which vertex should the method start writing to the output position/uv buffer.
- indexOffset
- At which index should the method start writing to the output index buffer.
- outPositions
- Previously allocated buffer where to store the vertex positions. Caller must ensure size and data type match the mesh type and vertex count retrieved from GetRenderElements() for the specified element.
- outUVs
- Previously allocated buffer where to store the vertex UVs. Caller must ensure size and data type match the mesh type and vertex count retrieved from GetRenderElements() for the specified element. Can be null if not needed.
- outIndices
- Previously allocated buffer where to store the indices. Caller must ensure size and data type match the mesh type and index count retrieved from GetRenderElements() for the specified element.
UpdateRenderElements
Recreates the internal render elements.
Must be called before GetRenderElementVertexAndIndexData/FillBuffer if element is dirty. Marks the element as non dirty.
SetElementDepth
Set element part of element depth.
Less significant than both widget and area depth.
GetElementDepth
Retrieve element part of element depth.
Less significant than both widget and area depth.
GetRenderElementDepthRange
Returns the range of depths that the child elements can be rendered it.
RefreshStyle
Updates element style based on active GUI style sheet.
Call this after active style sheet changes, or element class/id changes.
GetDepth
Returns GUI element depth.
This includes widget and area depth, but does not include specific per-render-element depth.
GetMargins
Returns GUI element margins.
Margins are modified by changing element style and determines minimum distance between GUI element border and surrounding GUI elements.
GetPadding
Returns GUI element padding.
Padding is modified by changing element style and determines minimum distance between GUI element border and contents.
SetLayoutData
Updates layout data that determines GUI elements relative position, size and depth in the GUI widget.
ChangeParentWidget
Changes the active GUI element widget.
This allows you to move an element to a different viewport, or change element style by using a widget with a different skin. You are allowed to pass null here, but elements with no parent will be unmanaged. You will be responsible for deleting them manually, and they will not render anywhere.
Protected
Methods
NotifyStyleChanged
Method that gets triggered whenever element style changes.
GetContentBounds
Similar to GetAbsoluteContentBounds(), except the bounds are relative to the parent GUI element rather than the parent widget.
GetScaledContentBounds
Similar to GetContentBounds(), but scaling has been applied to the position/size.
GetAbsoluteContentBounds
Returns bounds of the content contained within the GUI element.
This will be the bounds returned by GetAbsoluteBounds(), minus the border and the padding. Relative to parent widget.
GetContentOffset
Calculates the offset from the origin of the GUI element to the area containing content (combined border + padding offsets).
GetScaledContentOffset
Similar to GetContentOffset(), but scaling has been applied.
RegisterPseudoElement
Registers a new pseudo-element for the GUI element.
Pseudo-element can be used for providing additional style sheet rules for a GUI element.
- name
- Name of the pseudo-element. This will correspond to the pseudo-element in the style sheet (e.g.
toggle::checkmarkwill provide acheckmarkpseudo-element for thetoggleGUI element).
Returns: Index you can use to retrieve pseudo-element style information from GetPseudoElementStyleSheetRuleInformation().
GetPseudoElementStyleSheetRuleInformation
Returns style information for a pseudo-element at the specified index.