Search Results for

    Show / Hide Table of Contents

    Class Control

    Base class for all GUI controls

    Inheritance
    System.Object
    Control
    CurveEditor<T>.KeyframePoint
    CurveEditor<T>.TangentPoint
    Row
    GradientEditor.StopControl
    ToolStripSeparator
    CheckBox
    ContainerControl
    Implements
    System.IComparable
    IDrawable
    Namespace: FlaxEngine.GUI
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    public class Control : Object, IComparable, IDrawable

    Constructors

    Control()

    Initializes a new instance of the Control class.

    Declaration
    public Control()

    Control(Float2, Float2)

    Initializes a new instance of the Control class.

    Declaration
    public Control(Float2 location, Float2 size)
    Parameters
    Float2 location

    Upper left corner location.

    Float2 size

    Bounds size.

    Control(Rectangle)

    Init

    Declaration
    public Control(Rectangle bounds)
    Parameters
    Rectangle bounds

    Window bounds

    Control(Single, Single, Single, Single)

    Initializes a new instance of the Control class.

    Declaration
    public Control(float x, float y, float width, float height)
    Parameters
    System.Single x

    X coordinate

    System.Single y

    Y coordinate

    System.Single width

    Width

    System.Single height

    Height

    Properties

    AutoFocus

    If checked, the control can receive automatic focus (eg. on user click or UI navigation).

    Declaration
    [EditorOrder(512)]
    [Tooltip("If checked, the control can receive automatic focus (eg. on user click or UI navigation).")]
    public bool AutoFocus { get; set; }
    Property Value
    System.Boolean

    BackgroundBrush

    Gets or sets control background brush used to fill the contents. Uses Background Color property as tint color.

    Declaration
    [EditorDisplay("Background Style", null)]
    [EditorOrder(2001)]
    public IBrush BackgroundBrush { get; set; }
    Property Value
    IBrush

    BackgroundColor

    Gets or sets control background color (transparent color (alpha=0) means no background rendering)

    Declaration
    [ExpandGroups]
    [EditorDisplay("Background Style", null)]
    [EditorOrder(2000)]
    [Tooltip("The control background color. Use transparent color (alpha=0) to hide background.")]
    public Color BackgroundColor { get; set; }
    Property Value
    Color

    Bottom

    Gets Y coordinate of the bottom edge of the control relative to the upper-left corner of its container.

    Declaration
    public float Bottom { get; }
    Property Value
    System.Single

    BottomLeft

    Gets position of the bottom left of the control relative to the upper-left corner of its container.

    Declaration
    public Float2 BottomLeft { get; }
    Property Value
    Float2

    BottomRight

    Gets position of the bottom right corner of the control relative to the upper-left corner of its container.

    Declaration
    public Float2 BottomRight { get; }
    Property Value
    Float2

    ContainsFocus

    Gets a value indicating whether the control, currently has the input focus

    Declaration
    public virtual bool ContainsFocus { get; }
    Property Value
    System.Boolean

    DpiScale

    Gets the control DPI scale factor (1 is default). Includes custom DPI scale.

    Declaration
    public float DpiScale { get; }
    Property Value
    System.Single

    EditorBounds

    Bounds rectangle for editor UI.

    Declaration
    public virtual Rectangle EditorBounds { get; }
    Property Value
    Rectangle

    Enabled

    Gets or sets a value indicating whether the control can respond to user interaction

    Declaration
    [EditorOrder(520)]
    [Tooltip("If checked, control will receive input events of the user interaction.")]
    public bool Enabled { get; set; }
    Property Value
    System.Boolean

    EnabledInHierarchy

    Gets a value indicating whether the control is enabled in the hierarchy (it's enabled and all it's parents are enabled as well).

    Declaration
    public bool EnabledInHierarchy { get; }
    Property Value
    System.Boolean

    HasParent

    Checks if control has parent container control

    Declaration
    public bool HasParent { get; }
    Property Value
    System.Boolean

    IsDisposing

    Returns true if control is during disposing state (on destroy)

    Declaration
    public bool IsDisposing { get; }
    Property Value
    System.Boolean

    IsDragOver

    Check if mouse dragging is over that item or its child items.

    Declaration
    public virtual bool IsDragOver { get; }
    Property Value
    System.Boolean

    IsFocused

    Gets a value indicating whether the control has input focus

    Declaration
    public bool IsFocused { get; }
    Property Value
    System.Boolean

    IsMouseOver

    Check if mouse is over that item or its child items

    Declaration
    public virtual bool IsMouseOver { get; }
    Property Value
    System.Boolean

    IsNavFocused

    Gets a value indicating whether the control has UI navigation focus.

    Declaration
    public bool IsNavFocused { get; }
    Property Value
    System.Boolean

    IsTouchOver

    Check if touch is over that item or its child items

    Declaration
    public virtual bool IsTouchOver { get; }
    Property Value
    System.Boolean

    Left

    Gets X coordinate of the left edge of the control relative to the upper-left corner of its container.

    Declaration
    public float Left { get; }
    Property Value
    System.Single

    Pivot

    Gets or sets the normalized pivot location (used to transform control around it). Point (0,0) is upper left corner, (0.5,0.5) is center, (1,1) is bottom right corner.

    Declaration
    [ExpandGroups]
    [EditorDisplay("Transform", null)]
    [Limit(0F, 1F, 0.1F)]
    [EditorOrder(1030)]
    [Tooltip("The control rotation pivot location in normalized control size. Point (0,0) is upper left corner, (0.5,0.5) is center, (1,1) is bottom right corner.")]
    public Float2 Pivot { get; set; }
    Property Value
    Float2

    Right

    Gets X coordinate of the right edge of the control relative to the upper-left corner of its container.

    Declaration
    public float Right { get; }
    Property Value
    System.Single

    Root

    Gets the GUI tree root control which contains that control (or null if not linked to any)

    Declaration
    public virtual RootControl Root { get; }
    Property Value
    RootControl

    RootWindow

    Gets the GUI window root control which contains that control (or null if not linked to any).

    Declaration
    public virtual WindowRootControl RootWindow { get; }
    Property Value
    FlaxEngine.GUI.WindowRootControl

    Rotation

    Gets or sets the rotation angle (in degrees). Control is rotated around it's pivot point (middle of the control by default).

    Declaration
    [ExpandGroups]
    [EditorDisplay("Transform", null)]
    [EditorOrder(1050)]
    [Tooltip("The control rotation angle (in degrees). Control is rotated around it's pivot point (middle of the control by default).")]
    public float Rotation { get; set; }
    Property Value
    System.Single

    Scale

    Gets or sets the scale. Scales control according to its Pivot which by default is (0.5,0.5) (middle of the control). If you set pivot to (0,0) it will scale the control based on it's upper-left corner.

    Declaration
    [ExpandGroups]
    [EditorDisplay("Transform", null)]
    [Limit(-3.40282347E+38F, 3.40282347E+38F, 0.1F)]
    [EditorOrder(1020)]
    [Tooltip("The control scale parameter. Scales control according to its Pivot which by default is (0.5,0.5) (middle of the control). If you set pivot to (0,0) it will scale the control based on it's upper-left corner.")]
    public Float2 Scale { get; set; }
    Property Value
    Float2

    ScreenPos

    Gets screen position of the control (upper left corner).

    Declaration
    public Float2 ScreenPos { get; }
    Property Value
    Float2

    Shear

    Gets or sets the shear transform angles (x, y). Defined in degrees. Shearing happens relative to the control pivot point.

    Declaration
    [ExpandGroups]
    [EditorDisplay("Transform", null)]
    [EditorOrder(1040)]
    [Tooltip("The shear transform angles (x, y). Defined in degrees. Shearing happens relative to the control pivot point.")]
    public Float2 Shear { get; set; }
    Property Value
    Float2

    ShowTooltip

    Gets a value indicating whether show control tooltip (control is in a proper state, tooltip text is valid, etc.). Can be used to implement custom conditions for showing tooltips (eg. based on current mouse location within the control bounds).

    Declaration
    protected virtual bool ShowTooltip { get; }
    Property Value
    System.Boolean

    Remarks

    Tooltip can be only visible if mouse is over the control area (see IsMouseOver).

    Tooltip

    Gets the tooltip used by this control (custom or shared one).

    Declaration
    public Tooltip Tooltip { get; }
    Property Value
    FlaxEngine.GUI.Tooltip

    Top

    Gets Y coordinate of the top edge of the control relative to the upper-left corner of its container.

    Declaration
    public float Top { get; }
    Property Value
    System.Single

    UpperLeft

    Gets position of the upper left corner of the control relative to the upper-left corner of its container.

    Declaration
    public Float2 UpperLeft { get; }
    Property Value
    Float2

    UpperRight

    Gets position of the upper right corner of the control relative to the upper-left corner of its container.

    Declaration
    public Float2 UpperRight { get; }
    Property Value
    Float2

    Visible

    Gets or sets a value indicating whether the control is visible

    Declaration
    [EditorOrder(510)]
    [Tooltip("If checked, control will be visible.")]
    public bool Visible { get; set; }
    Property Value
    System.Boolean

    VisibleInHierarchy

    Gets a value indicating whether the control is visible in the hierarchy (it's visible and all it's parents are visible as well).

    Declaration
    public bool VisibleInHierarchy { get; }
    Property Value
    System.Boolean

    Methods

    AddUpdateCallbacks(RootControl)

    Adds the custom control logic update callbacks to the root.

    Declaration
    protected virtual void AddUpdateCallbacks(RootControl root)
    Parameters
    RootControl root

    The root.

    ClearState()

    Called to clear UI state. For example, removes mouse over state or drag and drop when control gets disabled or hidden (including hierarchy).

    Declaration
    public virtual void ClearState()

    Compare(Control)

    Compares this control with the other control.

    Declaration
    public virtual int Compare(Control other)
    Parameters
    Control other

    The other.

    Returns
    System.Int32

    Comparision result.

    CompareTo(Object)

    Declaration
    public int CompareTo(object obj)
    Parameters
    System.Object obj

    Returns
    System.Int32

    ContainsPoint(ref Float2, Boolean)

    Checks if this control contains given point in local Control Space.

    Declaration
    public virtual 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.

    Defocus()

    Removes input focus from the control

    Declaration
    public virtual void Defocus()

    Dispose()

    Delete control (will unlink from the parent and start to dispose)

    Declaration
    public void Dispose()

    DoDragDrop(DragData)

    Starts the drag and drop operation.

    Declaration
    [NoAnimate]
    public virtual void DoDragDrop(DragData data)
    Parameters
    DragData data

    The data.

    Draw()

    Draw control

    Declaration
    [NoAnimate]
    public virtual void Draw()
    Implements
    IDrawable.Draw()

    EndMouseCapture()

    Ends the mouse tracking.

    Declaration
    [NoAnimate]
    public void EndMouseCapture()

    Focus()

    Sets input focus to the control

    Declaration
    public virtual void Focus()

    Focus(Control)

    Focus that control

    Declaration
    protected virtual bool Focus(Control c)
    Parameters
    Control c

    Control to focus

    Returns
    System.Boolean

    True if control got a focus

    GetNavOrigin(NavDirection)

    Gets the navigation origin location for this control. It's the starting anchor point for searching navigable controls in the nearby area. By default the origin points are located on the control bounds edges.

    Declaration
    [NoAnimate]
    public virtual Float2 GetNavOrigin(NavDirection direction)
    Parameters
    NavDirection direction

    The navigation direction.

    Returns
    Float2

    The navigation origin for the automatic navigation.

    GetNavTarget(NavDirection)

    Gets the next navigation control to focus for the given direction. Returns null for automated direction resolving.

    Declaration
    [NoAnimate]
    public virtual Control GetNavTarget(NavDirection direction)
    Parameters
    NavDirection direction

    The navigation direction.

    Returns
    Control

    The target navigation control or null to use automatic navigation.

    IntersectsContent(ref Float2, out Float2)

    Checks if given location point in Parent Space intersects with the control content and calculates local position.

    Declaration
    public virtual bool IntersectsContent(ref Float2 locationParent, out Float2 location)
    Parameters
    Float2 locationParent

    The location in Parent Space.

    Float2 location

    The location of intersection in Control Space.

    Returns
    System.Boolean

    True if given point in Parent Space intersects with this control content, otherwise false.

    IsTouchPointerOver(Int32)

    Determines whether the given touch pointer is over the control.

    Declaration
    public virtual bool IsTouchPointerOver(int pointerId)
    Parameters
    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    Returns
    System.Boolean

    True if given touch pointer is over the control, otherwise false.

    LinkTooltip(String, Tooltip)

    Links the tooltip.

    Declaration
    [NoAnimate]
    public Control LinkTooltip(string text, Tooltip customTooltip = null)
    Parameters
    System.String text

    The text.

    FlaxEngine.GUI.Tooltip customTooltip

    The custom tooltip.

    Returns
    Control

    This control pointer. Useful for creating controls in code.

    NavigationFocus()

    Focuses the control by the UI navigation system. Called during navigating around UI with gamepad/keyboard navigation. Focuses the control and sets the IsNavFocused flag.

    Declaration
    public virtual void NavigationFocus()

    OnCharInput(Char)

    On input character

    Declaration
    [NoAnimate]
    public virtual bool OnCharInput(char c)
    Parameters
    System.Char c

    Input character

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    OnDestroy()

    Method called when managed instance should be destroyed

    Declaration
    [NoAnimate]
    public virtual void OnDestroy()

    OnDragDrop(ref Float2, DragData)

    When mouse dragging drops on control's area

    Declaration
    [NoAnimate]
    public virtual DragDropEffect OnDragDrop(ref Float2 location, DragData data)
    Parameters
    Float2 location

    Mouse location in Control Space

    DragData data

    The data. See DragDataText and DragDataFiles.

    Returns
    DragDropEffect

    The drag event result effect.

    OnDragEnter(ref Float2, DragData)

    When mouse dragging enters control's area

    Declaration
    [NoAnimate]
    public virtual DragDropEffect OnDragEnter(ref Float2 location, DragData data)
    Parameters
    Float2 location

    Mouse location in Control Space

    DragData data

    The data. See DragDataText and DragDataFiles.

    Returns
    DragDropEffect

    The drag event result effect.

    OnDragLeave()

    When mouse dragging leaves control's area

    Declaration
    [NoAnimate]
    public virtual void OnDragLeave()

    OnDragMove(ref Float2, DragData)

    When mouse dragging moves over control's area

    Declaration
    [NoAnimate]
    public virtual DragDropEffect OnDragMove(ref Float2 location, DragData data)
    Parameters
    Float2 location

    Mouse location in Control Space

    DragData data

    The data. See DragDataText and DragDataFiles.

    Returns
    DragDropEffect

    The drag event result effect.

    OnEndContainsFocus()

    Action fired when control lost 'Contains Focus' state

    Declaration
    [NoAnimate]
    public virtual void OnEndContainsFocus()

    OnEndMouseCapture()

    When mouse goes up/down not over the control but it has user focus so remove that focus from it (used by scroll bars, sliders etc.)

    Declaration
    [NoAnimate]
    public virtual void OnEndMouseCapture()

    OnGotFocus()

    When control gets input focus

    Declaration
    [NoAnimate]
    public virtual void OnGotFocus()

    OnKeyDown(KeyboardKeys)

    When key goes down

    Declaration
    [NoAnimate]
    public virtual bool OnKeyDown(KeyboardKeys key)
    Parameters
    KeyboardKeys key

    Key value

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    OnKeyUp(KeyboardKeys)

    When key goes up

    Declaration
    [NoAnimate]
    public virtual void OnKeyUp(KeyboardKeys key)
    Parameters
    KeyboardKeys key

    Key value

    OnLocationChanged()

    Called when control location gets changed.

    Declaration
    protected virtual void OnLocationChanged()

    OnLostFocus()

    When control losts input focus

    Declaration
    [NoAnimate]
    public virtual void OnLostFocus()

    OnMouseDoubleClick(Float2, MouseButton)

    When mouse double clicks over control's area

    Declaration
    [NoAnimate]
    public virtual bool OnMouseDoubleClick(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    OnMouseDown(Float2, MouseButton)

    When mouse goes down over control's area

    Declaration
    [NoAnimate]
    public virtual bool OnMouseDown(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    OnMouseEnter(Float2)

    When mouse enters control's area

    Declaration
    [NoAnimate]
    public virtual void OnMouseEnter(Float2 location)
    Parameters
    Float2 location

    Mouse location in Control Space

    OnMouseLeave()

    When mouse leaves control's area

    Declaration
    [NoAnimate]
    public virtual void OnMouseLeave()

    OnMouseMove(Float2)

    When mouse moves over control's area

    Declaration
    [NoAnimate]
    public virtual void OnMouseMove(Float2 location)
    Parameters
    Float2 location

    Mouse location in Control Space

    OnMouseUp(Float2, MouseButton)

    When mouse goes up over control's area

    Declaration
    [NoAnimate]
    public virtual bool OnMouseUp(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    OnMouseWheel(Float2, Single)

    When mouse wheel moves

    Declaration
    [NoAnimate]
    public virtual bool OnMouseWheel(Float2 location, float delta)
    Parameters
    Float2 location

    Mouse location in Control Space

    System.Single delta

    Mouse wheel move delta. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. Normalized to [-1;1] range.

    Returns
    System.Boolean

    True if event has been handled

    OnNavigate(NavDirection, Float2, Control, List<Control>)

    Performs the UI navigation for this control.

    Declaration
    public virtual Control OnNavigate(NavDirection direction, Float2 location, Control caller, List<Control> visited)
    Parameters
    NavDirection direction

    The navigation direction.

    Float2 location

    The navigation start location (in the control-space).

    Control caller

    The control that calls the event.

    System.Collections.Generic.List<Control> visited

    The list with visited controls. Used to skip recursive navigation calls when doing traversal across the UI hierarchy.

    Returns
    Control

    The target navigation control or null if didn't performed any navigation.

    OnParentChangedInternal()

    Action fired when parent control gets changed.

    Declaration
    protected virtual void OnParentChangedInternal()

    OnParentResized()

    Action fired when parent control gets resized (also when control gets non-null parent).

    Declaration
    public virtual void OnParentResized()

    OnShowTooltip(out String, out Float2, out Rectangle)

    Called when tooltip wants to be shown. Allows modifying its appearance.

    Declaration
    public virtual bool OnShowTooltip(out string text, out Float2 location, out Rectangle area)
    Parameters
    System.String text

    The tooltip text to show.

    Float2 location

    The popup start location (in this control local space).

    Rectangle area

    The allowed area of mouse movement to show tooltip (in this control local space).

    Returns
    System.Boolean

    True if can show tooltip, otherwise false to skip.

    OnSizeChanged()

    Called when control size gets changed.

    Declaration
    protected virtual void OnSizeChanged()

    OnStartContainsFocus()

    Action fired when control gets 'Contains Focus' state

    Declaration
    [NoAnimate]
    public virtual void OnStartContainsFocus()

    OnSubmit()

    Generic user interaction event for a control used by UI navigation (eg. user submits on the currently focused control).

    Declaration
    public virtual void OnSubmit()

    OnTestTooltipOverControl(ref Float2)

    Called when tooltip is visible and tests if the given mouse location (in control space) is valid (is over the content).

    Declaration
    public virtual bool OnTestTooltipOverControl(ref Float2 location)
    Parameters
    Float2 location

    The location.

    Returns
    System.Boolean

    True if tooltip can be still visible, otherwise false.

    OnTooltipShown(Tooltip)

    Called when tooltip gets created and shown for this control. Can be used to customize tooltip UI.

    Declaration
    public virtual void OnTooltipShown(Tooltip tooltip)
    Parameters
    FlaxEngine.GUI.Tooltip tooltip

    The tooltip.

    OnTouchDown(Float2, Int32)

    When touch enters control's area.

    Declaration
    [NoAnimate]
    public virtual bool OnTouchDown(Float2 location, int pointerId)
    Parameters
    Float2 location

    Touch location in Control Space.

    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    Returns
    System.Boolean

    True if event has been handled, otherwise false.

    OnTouchEnter(Float2, Int32)

    When touch enters control's area

    Declaration
    [NoAnimate]
    public virtual void OnTouchEnter(Float2 location, int pointerId)
    Parameters
    Float2 location

    Touch location in Control Space

    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    OnTouchLeave()

    When all touch leaves control's area

    Declaration
    [NoAnimate]
    public virtual void OnTouchLeave()

    OnTouchLeave(Int32)

    When touch leaves control's area

    Declaration
    [NoAnimate]
    public virtual void OnTouchLeave(int pointerId)
    Parameters
    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    OnTouchMove(Float2, Int32)

    When touch moves over control's area.

    Declaration
    [NoAnimate]
    public virtual void OnTouchMove(Float2 location, int pointerId)
    Parameters
    Float2 location

    Touch location in Control Space.

    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    OnTouchUp(Float2, Int32)

    When touch goes up over control's area.

    Declaration
    [NoAnimate]
    public virtual bool OnTouchUp(Float2 location, int pointerId)
    Parameters
    Float2 location

    Touch location in Control Space

    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    Returns
    System.Boolean

    True if event has been handled, otherwise false.

    OnVisibleChanged()

    Called when visible state gets changed.

    Declaration
    protected virtual void OnVisibleChanged()

    PerformLayout(Boolean)

    Update control layout

    Declaration
    [NoAnimate]
    public virtual void PerformLayout(bool force = false)
    Parameters
    System.Boolean force

    True if perform layout by force even if cached state wants to skip it due to optimization.

    PointFromParent(Float2)

    Converts point in parent control coordinates into local control's space.

    Declaration
    public Float2 PointFromParent(Float2 locationParent)
    Parameters
    Float2 locationParent

    The input location of the point to convert.

    Returns
    Float2

    The converted point location in control's space.

    PointFromParent(ref Float2)

    Converts point in parent control coordinates into local control's space.

    Declaration
    public virtual Float2 PointFromParent(ref Float2 locationParent)
    Parameters
    Float2 locationParent

    The input location of the point to convert.

    Returns
    Float2

    The converted point location in control's space.

    PointFromParent(ContainerControl, Float2)

    Converts point in one of the parent control coordinates into local control's space.

    Declaration
    public Float2 PointFromParent(ContainerControl parent, Float2 location)
    Parameters
    ContainerControl parent

    This control parent of any other parent.

    Float2 location

    Input location of the point to convert

    Returns
    Float2

    The converted point location in control's space.

    PointFromScreen(Float2)

    Converts point in screen coordinates into the local control's space

    Declaration
    public virtual Float2 PointFromScreen(Float2 location)
    Parameters
    Float2 location

    Input location of the point to convert

    Returns
    Float2

    Converted point location in local control's space

    PointFromWindow(Float2)

    Converts point in the window coordinates into control's space

    Declaration
    public Float2 PointFromWindow(Float2 location)
    Parameters
    Float2 location

    Input location of the point to convert

    Returns
    Float2

    Converted point location in control's space

    PointToParent(Float2)

    Converts point in local control's space into parent control coordinates.

    Declaration
    public Float2 PointToParent(Float2 location)
    Parameters
    Float2 location

    The input location of the point to convert.

    Returns
    Float2

    The converted point location in parent control coordinates.

    PointToParent(ref Float2)

    Converts point in local control's space into parent control coordinates.

    Declaration
    public virtual Float2 PointToParent(ref Float2 location)
    Parameters
    Float2 location

    The input location of the point to convert.

    Returns
    Float2

    The converted point location in parent control coordinates.

    PointToParent(ContainerControl, Float2)

    Converts point in local control's space into one of the parent control coordinates

    Declaration
    public Float2 PointToParent(ContainerControl parent, Float2 location)
    Parameters
    ContainerControl parent

    This control parent of any other parent.

    Float2 location

    Input location of the point to convert

    Returns
    Float2

    Converted point location in parent control coordinates

    PointToScreen(Float2)

    Converts point in the local control's space into screen coordinates

    Declaration
    public virtual Float2 PointToScreen(Float2 location)
    Parameters
    Float2 location

    Input location of the point to convert

    Returns
    Float2

    Converted point location in screen coordinates

    PointToWindow(Float2)

    Converts point in local control's space into window coordinates

    Declaration
    public Float2 PointToWindow(Float2 location)
    Parameters
    Float2 location

    Input location of the point to convert

    Returns
    Float2

    Converted point location in window coordinates

    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 virtual 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.

    RemoveUpdateCallbacks(RootControl)

    Removes the custom control logic update callbacks from the root.

    Declaration
    protected virtual void RemoveUpdateCallbacks(RootControl root)
    Parameters
    RootControl root

    The root.

    Resize(ref Float2)

    Resizes the control based on where the pivot is rather than just the top-left.

    Declaration
    [NoAnimate]
    public void Resize(ref Float2 value)
    Parameters
    Float2 value

    SetAnchorPreset(AnchorPresets, Boolean, Boolean)

    Sets the anchor preset for the control. Can be used to auto-place the control for a given preset or can preserve the current control bounds.

    Declaration
    public void SetAnchorPreset(AnchorPresets anchorPreset, bool preserveBounds, bool setPivotToo = false)
    Parameters
    AnchorPresets anchorPreset

    The anchor preset to set.

    System.Boolean preserveBounds

    True if preserve current control bounds, otherwise will align control position accordingly to the anchor location.

    System.Boolean setPivotToo

    Whether or not we should set the pivot too, eg left-top 0,0, bottom-right 1,1

    SetPivotInternal(ref Float2)

    Sets the pivot and updates the transform.

    Declaration
    protected virtual void SetPivotInternal(ref Float2 pivot)
    Parameters
    Float2 pivot

    The pivot.

    SetRotationInternal(Single)

    Sets the rotation angle and updates the transform.

    Declaration
    protected virtual void SetRotationInternal(float rotation)
    Parameters
    System.Single rotation

    The rotation (in degrees).

    SetScaleInternal(ref Float2)

    Sets the scale and updates the transform.

    Declaration
    protected virtual void SetScaleInternal(ref Float2 scale)
    Parameters
    Float2 scale

    The scale.

    SetShearInternal(ref Float2)

    Sets the shear and updates the transform.

    Declaration
    protected virtual void SetShearInternal(ref Float2 shear)
    Parameters
    Float2 shear

    The shear.

    SetUpdate(ref Control.UpdateDelegate, Control.UpdateDelegate)

    Helper utility function to sets the update callback to the root. Does nothing if value has not been modified. Handles if control has no root or parent.

    Declaration
    protected void SetUpdate(ref Control.UpdateDelegate onUpdate, Control.UpdateDelegate value)
    Parameters
    Control.UpdateDelegate onUpdate

    The cached update callback delegate (field in the custom control implementation).

    Control.UpdateDelegate value

    The value to assign.

    StartMouseCapture(Boolean)

    Starts the mouse tracking. Used by the scrollbars, splitters, etc.

    Declaration
    [NoAnimate]
    public void StartMouseCapture(bool useMouseScreenOffset = false)
    Parameters
    System.Boolean useMouseScreenOffset

    If set to true will use mouse screen offset.

    UnlinkTooltip()

    Unlinks the tooltip.

    Declaration
    [NoAnimate]
    public void UnlinkTooltip()

    Update(Single)

    Perform control update and all its children

    Declaration
    [NoAnimate]
    public virtual void Update(float deltaTime)
    Parameters
    System.Single deltaTime

    Delta time in seconds

    UpdateBounds()

    Updates the control cached bounds (based on anchors and offsets).

    Declaration
    [NoAnimate]
    public void UpdateBounds()

    UpdateTransform()

    Updates the control cached transformation matrix (based on bounds).

    Declaration
    [NoAnimate]
    public void UpdateTransform()

    Events

    LocationChanged

    Action is invoked, when location is changed

    Declaration
    public event Action<Control> LocationChanged
    Event Type
    System.Action<Control>

    ParentChanged

    Action is invoked, when parent is changed

    Declaration
    public event Action<Control> ParentChanged
    Event Type
    System.Action<Control>

    SizeChanged

    Action is invoked, when size is changed

    Declaration
    public event Action<Control> SizeChanged
    Event Type
    System.Action<Control>

    VisibleChanged

    Action is invoked, when visibility is changed

    Declaration
    public event Action<Control> VisibleChanged
    Event Type
    System.Action<Control>

    Extension Methods

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