Search Results for

    Show / Hide Table of Contents

    Class Label

    The basic GUI label control.

    Inheritance
    System.Object
    Control
    ContainerControl
    Label
    Button
    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.PerformLayoutAfterChildren()
    ContainerControl.OnDestroy()
    ContainerControl.Update(Single)
    ContainerControl.ClearState()
    ContainerControl.Draw()
    ContainerControl.DrawChildren()
    ContainerControl.ContainsPoint(Float2, Boolean)
    ContainerControl.PerformLayout(Boolean)
    ContainerControl.RayCast(Float2, Control)
    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.Root
    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
    [ActorToolbox("GUI")]
    public class Label : ContainerControl, IComparable, IDrawable

    Constructors

    Label()

    Initializes a new instance of the Label class.

    Declaration
    public Label()

    Label(Single, Single, Single, Single)

    Initializes a new instance of the ContainerControl class.

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

    System.Single y

    System.Single width

    System.Single height

    Fields

    _font

    The font.

    Declaration
    protected FontReference _font
    Field Value
    FontReference

    _text

    The text.

    Declaration
    protected LocalizedString _text
    Field Value
    LocalizedString

    Properties

    AutoFitText

    Gets or sets a value indicating whether scale text to fit the label control bounds. Disables using text alignment, automatic width and height.

    Declaration
    [EditorOrder(100)]
    [Tooltip("If checked, enables scaling text to fit the label control bounds. Disables using text alignment, automatic width and height.")]
    public bool AutoFitText { get; set; }
    Property Value
    System.Boolean

    AutoFitTextRange

    Gets or sets the text scale range (min and max) for automatic fit text option. Can be used to constraint the text scale adjustment.

    Declaration
    [VisibleIf("AutoFitText", false)]
    [EditorOrder(110)]
    [Tooltip("The text scale range (min and max) for automatic fit text option. Can be used to constraint the text scale adjustment.")]
    public Float2 AutoFitTextRange { get; set; }
    Property Value
    Float2

    AutoHeight

    Gets or sets a value indicating whether set automatic height based on text contents. Control size is modified relative to the Pivot.

    Declaration
    [EditorOrder(90)]
    [Tooltip("If checked, the control height will be based on text contents. Control size is modified relative to the Pivot.")]
    public bool AutoHeight { get; set; }
    Property Value
    System.Boolean

    AutoWidth

    Gets or sets a value indicating whether set automatic width based on text contents. Control size is modified relative to the Pivot.

    Declaration
    [EditorOrder(85)]
    [Tooltip("If checked, the control width will be based on text contents. Control size is modified relative to the Pivot.")]
    public bool AutoWidth { get; set; }
    Property Value
    System.Boolean

    BaseLinesGapScale

    Gets or sets the text wrapping within the control bounds.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2023)]
    [Tooltip("The gap between lines when wrapping and more than a single line is displayed.")]
    [Limit(0F, 3.40282347E+38F, 1F)]
    public float BaseLinesGapScale { get; set; }
    Property Value
    System.Single

    Bold

    Whether to bold the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2001)]
    [Tooltip("Bold the text.")]
    public bool Bold { get; set; }
    Property Value
    System.Boolean

    CaseOption

    The text case.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2000)]
    [Tooltip("The case of the text.")]
    public TextCaseOptions CaseOption { get; set; }
    Property Value
    TextCaseOptions

    ClipText

    Gets or sets a value indicating whether clip text during rendering.

    Declaration
    [EditorOrder(80)]
    [Tooltip("If checked, text will be clipped during rendering.")]
    public bool ClipText { get; set; }
    Property Value
    System.Boolean

    Font

    Gets or sets the font.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2024)]
    public FontReference Font { get; set; }
    Property Value
    FontReference

    HorizontalAlignment

    Gets or sets the horizontal text alignment within the control bounds.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2020)]
    [Tooltip("The horizontal text alignment within the control bounds.")]
    public TextAlignment HorizontalAlignment { get; set; }
    Property Value
    TextAlignment

    Italic

    Whether to italicize the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2002)]
    [Tooltip("Italicize the text.")]
    public bool Italic { get; set; }
    Property Value
    System.Boolean

    Margin

    Gets or sets the margin for the text within the control bounds.

    Declaration
    [EditorOrder(70)]
    [Tooltip("The margin for the text within the control bounds.")]
    public Margin Margin { get; set; }
    Property Value
    Margin

    Material

    Gets or sets the custom material used to render the text. It has to have domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2025)]
    public MaterialBase Material { get; set; }
    Property Value
    MaterialBase

    Text

    Gets or sets the text.

    Declaration
    [EditorOrder(10)]
    [MultilineText]
    [Tooltip("The label text.")]
    public LocalizedString Text { get; set; }
    Property Value
    LocalizedString

    TextColor

    Gets or sets the color of the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2010)]
    [Tooltip("The color of the text.")]
    [ExpandGroups]
    public Color TextColor { get; set; }
    Property Value
    Color

    TextColorHighlighted

    Gets or sets the color of the text when it is highlighted (mouse is over).

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2011)]
    [Tooltip("The color of the text when it is highlighted (mouse is over).")]
    public Color TextColorHighlighted { get; set; }
    Property Value
    Color

    VerticalAlignment

    Gets or sets the vertical text alignment within the control bounds.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2021)]
    [Tooltip("The vertical text alignment within the control bounds.")]
    public TextAlignment VerticalAlignment { get; set; }
    Property Value
    TextAlignment

    Wrapping

    Gets or sets the text wrapping within the control bounds.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2022)]
    [Tooltip("The text wrapping within the control bounds.")]
    public TextWrapping Wrapping { get; set; }
    Property Value
    TextWrapping

    Methods

    DrawSelf()

    Draws the control.

    Declaration
    public override void DrawSelf()
    Overrides
    ContainerControl.DrawSelf()

    PerformLayoutBeforeChildren()

    Perform layout for that container control before performing it for child controls.

    Declaration
    protected override void PerformLayoutBeforeChildren()
    Overrides
    ContainerControl.PerformLayoutBeforeChildren()

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)

    See Also

    ContainerControl
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat