class
GUIManager
Manages the rendering and input of all GUI widgets in the scene.
Public
Constructors
GUIManager
Methods
~GUIManager
RegisterWidget
Registers a newly created widget with the GUI manager.
This should be called by every GUI widget on creation.
UnregisterWidget
Unregisters a GUI widget from the GUI manager.
This should be called by every GUI widget before getting deleted.
Update
Called once per frame.
QueueForDestroy
Queues the GUI element for destruction.
Element will be destroyed during the next call to update().
ProcessDestroyQueue
Forces all GUI elements that are queued for destruction to be destroyed immediately.
SetFocus
Change the GUI element focus state.
- element
- Element whose focus state to change
- focus
- Give the element focus or take it away.
- clear
- If true the focus will be cleared from any elements currently in focus. Otherwise the element will just be appended to the in-focus list (if enabling focus).
SetCaretColor
Changes the color of the input caret used in input boxes and similar controls.
SetTextSelectionColor
Changes the text selection highlight color used in input boxes and similar controls.
GetCaretTexture
Returns the default caret texture used for rendering the input caret sprite.
GetTextSelectionTexture
Returns the default selection highlight texture used for rendering the selection highlight sprites.
GetCaretBlinkState
Checks is the input caret visible this frame.
GetInputCaretTool
Returns input caret helper tool that allows you to easily position and show an input caret in your GUI controls.
GetInputSelectionTool
Returns input selection helper tool that allows you to easily position and show an input selection highlight in your GUI controls.
GetVectorSpriteAtlas
Returns an atlas that vector paths are rasterized into.
Any GUI element using vector paths will register the path in this atlas. GUI manager will then rasterize the shapes before they are needed in GUI rendering.
SetInputBridge
Allows you to bridge GUI input from a GUI element into another render target.
- renderTex
- The render target to which to bridge the input.
- element
- The element from which to bridge input. Input will be transformed according to this elements position and size. Provide nullptr if you want to remove a bridge for the specified widget.
WindowToBridgedCoords
Converts window coordinates to coordinates relative to the specified bridged render target (target displayed with a GUI element).
Returned coordinates will be relative to the bridge element.
Returns: If provided widget has no bridge, coordinates are returned as is.
GetBridgeWindow
Returns the render window that holds the GUI element that displays the provided render texture.
- target
- Render texture to find the bridged window for.
Returns: Window that displays the GUI element with the render texture, or null if the render texture is not bridged.
GetBridgedElements
Returns all GUI elements that have input bridging set up and belong to the provided GUI widget.
GetWidgetWindow
Returns the parent render window of the specified widget.
staticInstance
Returns a reference to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticInstancePtr
Returns a pointer to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticShutDown
Shuts down this module and frees any resources it is using.
staticIsStarted
Query if the module has been started.
Protected
Methods
~Module<T>
OnStartUp
Override if you want your module to be notified once it has been constructed and started.
OnShutDown
Override if you want your module to be notified just before it is deleted.
staticInstanceInternal
Returns a singleton instance of this module.
Private
Methods
UpdateCaretTexture
Recreates the input caret texture.
UpdateTextSelectionTexture
Recreates the input text selection highlight texture.
DestroyRenderer
Destroys the render thread counterpart of the GUI manager.
- renderer
- Previously constructed render thread GUI manager instance.
ProcessDestroyQueueIteration
Destroys any elements or widgets queued for destruction.
FindElementUnderPointer
Finds a GUI element under the pointer at the specified screen position.
This method will also trigger pointer move/hover/leave events.
- screenMousePos
- Position of the pointer in screen coordinates.
- buttonStates
- States of the three mouse buttons (left, right, middle).
- shift
- Is shift key held.
- control
- Is control key held.
- alt
- Is alt key held.
OnPointerMoved
Called whenever a pointer (for example mouse cursor) is moved.
OnPointerReleased
Called whenever a pointer button (for example mouse button) is released.
OnPointerPressed
Called whenever a pointer button (for example mouse button) is pressed.
OnPointerDoubleClick
Called whenever a pointer button (for example mouse button) is double clicked.
OnInputCommandEntered
Called whenever an input command is input.
OnVirtualButtonDown
Called whenever a virtual button is pressed.
OnMouseDragEnded
Called by the drag and drop managed to notify us the drag ended.
OnWindowFocusGained
Called when the specified window gains focus.
OnWindowFocusLost
Called when the specified window loses focus.
OnMouseLeftWindow
Called when the mouse leaves the specified window.
ButtonToGuiButton
Converts pointer buttons to mouse buttons.
GetWidgetRelativePos
Converts screen coordinates to coordinates relative to the specified widget.
HideTooltip
Hides the tooltip if any is shown.
TabFocusFirst
Switches the focus to the first element in the tab group.
TabFocusNext
Switches the focus to the next element in the tab group.
Usually triggered when the user hits Tab key.
SendMouseEvent
Sends a mouse event to the specified GUI element.
SendTextInputEvent
Sends a text input event to the specified GUI element.
SendCommandEvent
Sends a command event to the specified GUI element.
SendVirtualButtonEvent
Sends a virtual button event to the specified GUI element.