Class Label
The basic GUI label control.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorToolbox("GUI")]
public class Label : ContainerControl, IComparable, IDrawable
Constructors
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
_text
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
PerformLayoutBeforeChildren()
Perform layout for that container control before performing it for child controls.
Declaration
protected override void PerformLayoutBeforeChildren()