class
GUIInteractable
Represents a GUI element that can be interacted with.
All interactable elements are also renderable (i.e. have a visual component).
Public
Constructors
GUIInteractable
GUIInteractable
Methods
~GUIInteractable
SetFocus
Change the GUI element focus state.
- enabled
- 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).
SetOptionFlags
A set of flags controlling various aspects of the GUIElement.
See GUIElementOptions.
GetOptionFlags
SetContextMenu
Assigns a new context menu that will be opened when the element is right clicked.
Null is allowed in case no context menu is wanted.
IsInInteractionBounds
Checks is the specified position within interactable bounds of a GUI element.
These are the bounds that will be used for hit tests for e.g. mouse cursor. By default this is the same as the absolute clipped bounds of the GUI element. Position is relative to parent GUI widget.
Destroy
Destroy the element.
Removes it from parent and widget, and queues it for deletion. Element memory will be released delayed, next frame.
staticGetRttiStatic
Fields
Internal
Methods
DoOnMouseEvent
Called when a mouse event is received on any GUI element the mouse is interacting with.
Return true if you have processed the event and don't want other elements to process it.
DoOnTextInputEvent
Called when some text is input and the GUI element has input focus.
Return true if you have processed the event and don't want other elements to process it.
DoOnCommandEvent
Called when a command event is triggered.
Return true if you have processed the event and don't want other elements to process it.
DoOnVirtualButtonEvent
Called when a virtual button is pressed/released and the GUI element has input focus.
Return true if you have processed the event and don't want other elements to process it.
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.
NotifyStateFlagsChanged
Notifies the system the state flag was added or removed.
AddStateFlags
Transitions the GUI element into a new state by adding state flags.
RemoveStateFlags
Transitions the GUI element into a new state by removing state flags.
HasCustomCursor
Checks if the GUI element has a custom cursor and outputs the cursor type if it does.
AcceptDragAndDrop
Checks if the GUI element accepts a drag and drop operation of the specified type.
GetContextMenu
Returns a context menu if a GUI element has one.
Otherwise returns nullptr.
GetTooltip
Returns text to display when hovering over the element.
Returns empty string if no tooltip.