Search Results for

    Show / Hide Table of Contents

    Class RootControl

    GUI root control that is represented by a window or a canvas and can contain children but has no parent at all. It's a source of the input events.

    Inheritance
    System.Object
    Control
    ContainerControl
    RootControl
    Implements
    System.IComparable
    IDrawable
    Inherited Members
    ContainerControl._children
    ContainerControl._containsFocus
    ContainerControl._isLayoutLocked
    ContainerControl.LockChildrenRecursive()
    ContainerControl.UnlockChildrenRecursive()
    ContainerControl.RemoveChildren()
    ContainerControl.DisposeChildren()
    ContainerControl.AddChild<T>()
    ContainerControl.AddChild<T>(T)
    ContainerControl.RemoveChild(Control)
    ContainerControl.GetChild(Int32)
    ContainerControl.GetChild<T>()
    ContainerControl.GetChildIndex(Control)
    ContainerControl.GetChildIndexAt(Float2)
    ContainerControl.GetChildAt(Float2)
    ContainerControl.GetChildAt(Float2, Func<Control, Boolean>)
    ContainerControl.GetChildAtRecursive(Float2)
    ContainerControl.GetClientArea()
    ContainerControl.SortChildren()
    ContainerControl.SortChildrenRecursive()
    ContainerControl.OnChildResized(Control)
    ContainerControl.OnChildrenChanged()
    ContainerControl.GetDesireClientArea(Rectangle)
    ContainerControl.IntersectsChildContent(Control, Float2, Float2)
    ContainerControl.OnNavigate(NavDirection, Float2, Control, List<Control>)
    ContainerControl.CanNavigateChild(Control)
    ContainerControl.NavigationWrap(NavDirection, Float2, List<Control>, Float2)
    ContainerControl.UpdateContainsFocus()
    ContainerControl.UpdateChildrenBounds()
    ContainerControl.PerformLayoutBeforeChildren()
    ContainerControl.PerformLayoutAfterChildren()
    ContainerControl.OnDestroy()
    ContainerControl.ClearState()
    ContainerControl.Draw()
    ContainerControl.DrawSelf()
    ContainerControl.DrawChildren()
    ContainerControl.PerformLayout(Boolean)
    ContainerControl.OnMouseEnter(Float2)
    ContainerControl.OnMouseMove(Float2)
    ContainerControl.OnMouseLeave()
    ContainerControl.OnMouseWheel(Float2, Single)
    ContainerControl.OnMouseDown(Float2, MouseButton)
    ContainerControl.OnMouseUp(Float2, MouseButton)
    ContainerControl.OnMouseDoubleClick(Float2, MouseButton)
    ContainerControl.IsTouchPointerOver(Int32)
    ContainerControl.OnTouchEnter(Float2, Int32)
    ContainerControl.OnTouchDown(Float2, Int32)
    ContainerControl.OnTouchMove(Float2, Int32)
    ContainerControl.OnTouchUp(Float2, Int32)
    ContainerControl.OnTouchLeave(Int32)
    ContainerControl.OnCharInput(Char)
    ContainerControl.OnKeyDown(KeyboardKeys)
    ContainerControl.OnKeyUp(KeyboardKeys)
    ContainerControl.OnDragEnter(Float2, DragData)
    ContainerControl.OnDragMove(Float2, DragData)
    ContainerControl.OnDragLeave()
    ContainerControl.OnDragDrop(Float2, DragData)
    ContainerControl.OnSizeChanged()
    ContainerControl.Children
    ContainerControl.ChildrenCount
    ContainerControl.HasChildren
    ContainerControl.ContainsFocus
    ContainerControl.ClipChildren
    ContainerControl.CullChildren
    ContainerControl.IsTouchOver
    Control.Resize(Float2)
    Control.UpdateBounds()
    Control.UpdateTransform()
    Control.SetAnchorPreset(AnchorPresets, Boolean, Boolean)
    Control.Dispose()
    Control.Focus()
    Control.Defocus()
    Control.OnGotFocus()
    Control.OnLostFocus()
    Control.OnStartContainsFocus()
    Control.OnEndContainsFocus()
    Control.Focus(Control)
    Control.StartMouseCapture(Boolean)
    Control.EndMouseCapture()
    Control.OnEndMouseCapture()
    Control.GetNavTarget(NavDirection)
    Control.GetNavOrigin(NavDirection)
    Control.NavigationFocus()
    Control.OnSubmit()
    Control.OnTouchLeave()
    Control.DoDragDrop(DragData)
    Control.LinkTooltip(String, Tooltip)
    Control.UnlinkTooltip()
    Control.OnShowTooltip(String, Float2, Rectangle)
    Control.OnTooltipShown(Tooltip)
    Control.OnTestTooltipOverControl(Float2)
    Control.IntersectsContent(Float2, Float2)
    Control.PointToParent(ContainerControl, Float2)
    Control.PointToParent(Float2)
    Control.PointToParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(ContainerControl, Float2)
    Control.PointToWindow(Float2)
    Control.PointFromWindow(Float2)
    Control.PointToScreen(Float2)
    Control.PointFromScreen(Float2)
    Control.OnLocationChanged()
    Control.SetScaleInternal(Float2)
    Control.SetPivotInternal(Float2)
    Control.SetShearInternal(Float2)
    Control.SetRotationInternal(Single)
    Control.OnVisibleChanged()
    Control.OnParentChangedInternal()
    Control.AddUpdateCallbacks(RootControl)
    Control.RemoveUpdateCallbacks(RootControl)
    Control.SetUpdate(Control.UpdateDelegate, Control.UpdateDelegate)
    Control.OnParentResized()
    Control.CompareTo(Object)
    Control.Compare(Control)
    Control.Top
    Control.Bottom
    Control.Left
    Control.Right
    Control.UpperLeft
    Control.UpperRight
    Control.BottomRight
    Control.BottomLeft
    Control.Scale
    Control.Pivot
    Control.Shear
    Control.Rotation
    Control.HasParent
    Control.BackgroundColor
    Control.BackgroundBrush
    Control.Enabled
    Control.EnabledInHierarchy
    Control.Visible
    Control.VisibleInHierarchy
    Control.IsDisposing
    Control.RootWindow
    Control.DpiScale
    Control.ScreenPos
    Control.AutoFocus
    Control.IsFocused
    Control.IsNavFocused
    Control.IsMouseOver
    Control.IsDragOver
    Control.Tooltip
    Control.ShowTooltip
    Control.EditorBounds
    Control.LocationChanged
    Control.SizeChanged
    Control.ParentChanged
    Control.VisibleChanged
    Namespace: FlaxEngine.GUI
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    public abstract class RootControl : ContainerControl, IComparable, IDrawable

    Constructors

    RootControl()

    Initializes a new instance of the RootControl class.

    Declaration
    protected RootControl()

    Fields

    CustomNavigation

    The custom callback function for UI navigation. Can be used to override the default behaviour.

    Declaration
    public Action<NavDirection> CustomNavigation
    Field Value
    System.Action<NavDirection>

    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
    Control.Root

    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
    ContainerControl.ContainsPoint(ref Float2, Boolean)

    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)

    Performs the UI navigation.

    Declaration
    public void Navigate(NavDirection direction)
    Parameters
    NavDirection direction

    The navigation direction.

    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
    ContainerControl.RayCast(ref Float2, out Control)

    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 true will use mouse screen offset.

    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

    Overrides
    ContainerControl.Update(Single)

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat