class
GUIWidget
A top level container for all types of GUI elements.
Every GUI element, layout or area must be assigned to a widget in order to be rendered.
Widgets are the only GUI objects that may be arbitrarily transformed, allowing you to create 3D interfaces.
Public
Constructors
GUIWidget
Methods
~GUIWidget
GetStyleSheetCascade
Determines the style sheets that all GUI elements part of this widget will lookup styles in.
SetStyleSheetCascade
SetDepth
Determines the depth to render the widget at.
If two widgets overlap the widget with the lower depth will be rendered in front.
GetDepth
InBounds
Checks are the specified coordinates within widget bounds.
Coordinates should be relative to the parent window.
GetBounds
Returns bounds of the widget, relative to the parent window.
GetDPIScale
Returns currently set DPI scale.
Scale of 1.0 corresponds to 96 DPI. physical pixel = logical pixel * DPI scale logical pixel = physical pixel / DPI ccale;
SetDPIScale
Changes the DPI scale of all the GUI elements in the widget.
Triggers a full GUI rebuild.
GetTarget
SetCamera
Changes to which camera does the widget output its contents.
GetCamera
Returns the camera this widget is being rendered to.
GetElements
Returns a list of all elements parented to this widget.
staticGetRttiStatic
Fields
Internal
Methods
RegisterElement
Registers a new element as a child of the widget.
UnregisterElement
Unregisters an element from the widget.
Usually called when the element is destroyed, or reparented to another widget.
NotifyElementVisibilityChanged
Called when a registered GUI element is hidden, culled or visible.
Only needs to be called if visibility changes after registration.
MarkMeshDirty
Marks the widget mesh dirty requiring a mesh rebuild.
Provided element is the one that requested the mesh update.
MarkContentDirty
Marks the elements content as dirty, meaning its internal mesh will need to be rebuilt (this implies the entire widget mesh will be rebuilt as well).
MarkLayoutDirty
Marks the element layout as dirty.
This means layout for the element and all child elements will be re-calculated.
Note you almost always want to call this method on a parent of the GUI element whose layout needs to update. In particular, you want to call it on the top-most parent that doesn't have a fixed size. This is because size changes in a child element can affect its siblings as well as parents, if those elements are using automatic layouts.
If is null, then entire widget's layout will be marked as dirty.
MarkAbsoluteCoordinatesDirty
Marks the element's absolute coordinates as dirty.
This will trigger a recalculation of absolute coordinates for all the children of . You should call this when a GUI element moves, or when the area its children are viewed through changes (e.g. scroll area is scrolled).
UpdateLayout
Updates the layout of all child elements, repositioning and resizing them as needed.
UpdateLayout
Updates the layout of the provided element, and queues content updates.
UpdateRenderTarget
Checks if the render target of the destination camera changed, and updates the widget with new information if it has.
Should be called every frame.
RebuildDirtyRenderData
Rebuilds any dirty data required for GUI element rendering and returns the data required for updating the GUI renderer.
Protected
Constructors
GUIWidget
Constructs a new GUI widget attached to the specified parent scene object.
Widget elements will be rendered on the provided camera.
Methods
Update
Called once per frame.
Only called if the component is in Running state.
OnCreated
Called once when the component has been created.
Called regardless of the state the component is in.
OnDestroyed
Called once just before the component is destroyed.
Called regardless of the state the component is in.
OnTransformChanged
Called when the component's parent scene object has changed.
Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().
OwnerTargetResized
Called when the viewport size changes and widget elements need to be updated.
OwnerWindowFocusChanged
Called when the parent window gained or lost focus.
Private
Methods
UpdateBounds
Calculates widget bounds using the bounds of all child elements.
UpdateRootPanel
Updates the size of the primary GUI panel based on the viewport.