Class RootControl
GUI root control that is represented by a window or an canvas and can contain children but has no parent at all. It's a source of the input events.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
public abstract class RootControl : ContainerControl, IComparable, IDrawable
Constructors
RootControl()
Fields
CustomNavigation
UpdateCallbacks
The update callbacks collection. Controls can register for this to get the update event for logic handling.
Declaration
public readonly List<Control.UpdateDelegate> UpdateCallbacks
Field Value
System.Collections.Generic.List<Control.UpdateDelegate>
|
UpdateCallbacksToAdd
The update callbacks to add before invoking the update.
Declaration
public List<Control.UpdateDelegate> UpdateCallbacksToAdd
Field Value
System.Collections.Generic.List<Control.UpdateDelegate>
|
UpdateCallbacksToRemove
The update callbacks to remove before invoking the update.
Declaration
public List<Control.UpdateDelegate> UpdateCallbacksToRemove
Field Value
System.Collections.Generic.List<Control.UpdateDelegate>
|
Properties
FocusedControl
Gets or sets the current focused control
Declaration
public abstract Control FocusedControl { get; set; }
Property Value
Control
|
GameRoot
Gets the main GUI control (it can be window or editor overriden control). Use it to plug-in custom GUI controls.
Declaration
public static ContainerControl GameRoot { get; }
Property Value
ContainerControl
|
MousePosition
Gets or sets the position of the mouse in the window space coordinates.
Declaration
public abstract Float2 MousePosition { get; set; }
Property Value
Float2
|
Root
Gets the GUI tree root control which contains that control (or null if not linked to any)
Declaration
public override RootControl Root { get; }
Property Value
RootControl
|
Overrides
TrackingMouseOffset
Gets the tracking mouse offset.
Declaration
public abstract Float2 TrackingMouseOffset { get; }
Property Value
Float2
|
Methods
ContainsPoint(ref Float2, Boolean)
Checks if this control contains given point in local Control Space.
Declaration
public override bool ContainsPoint(ref Float2 location, bool precise = false)
Parameters
Float2
location
Point location in Control Space to check |
System.Boolean
precise
True if perform precise intersection test against the control content (eg. with hit mask or transparency threshold). Otherwise, only simple bounds-check will be performed. |
Returns
System.Boolean
True if point is inside control's area, otherwise false. |
Overrides
EndTrackingMouse()
Ends the mouse tracking.
Declaration
public abstract void EndTrackingMouse()
GetKey(KeyboardKeys)
Gets keyboard key state.
Declaration
public abstract bool GetKey(KeyboardKeys key)
Parameters
KeyboardKeys
key
Key to check. |
Returns
System.Boolean
True while the user holds down the key identified by id. |
GetKeyDown(KeyboardKeys)
Gets keyboard key down state.
Declaration
public abstract bool GetKeyDown(KeyboardKeys key)
Parameters
KeyboardKeys
key
Key to check. |
Returns
System.Boolean
True during the frame the user starts pressing down the key. |
GetKeyUp(KeyboardKeys)
Gets keyboard key up state.
Declaration
public abstract bool GetKeyUp(KeyboardKeys key)
Parameters
KeyboardKeys
key
Key to check. |
Returns
System.Boolean
True during the frame the user releases the button. |
GetMouseButton(MouseButton)
Gets mouse button state.
Declaration
public abstract bool GetMouseButton(MouseButton button)
Parameters
MouseButton
button
Mouse button to check. |
Returns
System.Boolean
True while the user holds down the button. |
GetMouseButtonDown(MouseButton)
Gets mouse button down state.
Declaration
public abstract bool GetMouseButtonDown(MouseButton button)
Parameters
MouseButton
button
Mouse button to check. |
Returns
System.Boolean
True during the frame the user starts pressing down the button. |
GetMouseButtonUp(MouseButton)
Gets mouse button up state.
Declaration
public abstract bool GetMouseButtonUp(MouseButton button)
Parameters
MouseButton
button
Mouse button to check. |
Returns
System.Boolean
True during the frame the user releases the button. |
Navigate(NavDirection)
RayCast(ref Float2, out Control)
Performs a raycast against UI controls hierarchy to find any intersecting control content. Uses ContainsPoint(ref Float2, Boolean) with precise check (skips transparent surfaces and empty panels).
Declaration
public override bool RayCast(ref Float2 location, out Control hit)
Parameters
Float2
location
The position to intersect UI with. |
Control
hit
The result control that intersects with the raycast. |
Returns
System.Boolean
True if ray hits any matching control, otherwise false. |
Overrides
StartTrackingMouse(Control, Boolean)
Starts the mouse tracking. Used by the scrollbars, splitters, etc.
Declaration
public abstract void StartTrackingMouse(Control control, bool useMouseScreenOffset)
Parameters
Control
control
The target control that want to track mouse. It will receive OnMouseMove event. |
System.Boolean
useMouseScreenOffset
If set to |
SubmitFocused()
Submits the currently focused control.
Declaration
public void SubmitFocused()
Update(Single)
Perform control update and all its children
Declaration
public override void Update(float deltaTime)
Parameters
System.Single
deltaTime
Delta time in seconds |