Class Label
- Namespace
- UILib.Components
- Assembly
- UILib.dll
A component which just displays some text.
public class Label : UIComponent
- Inheritance
-
Label
- Inherited Members
Constructors
Label(string, int)
Initializes a label.
public Label(string text, int fontSize)
Parameters
Properties
text
The underlying Unity Text.
public Text text { get; }
Property Value
- Text
Methods
SetAlignment(AnchorType)
Sets the alignment for the text.
public void SetAlignment(AnchorType alignment)
Parameters
alignmentAnchorTypeThe alignment to use
SetColor(Color)
Set the color of the text on this label.
public void SetColor(Color color)
Parameters
colorColorThe color to set
SetText(string)
Sets the text on this label.
public void SetText(string text)
Parameters
textstringThe text to set
SetThisTheme(Theme)
Allows setting the theme of this label.
This handles setting the theme specifically for this component, not its children. It's protected to allow overriding if you were to create a subclass.
In most cases, you'd probably want to use SetTheme(Theme) instead.
protected override void SetThisTheme(Theme theme)
Parameters
themeThemeThe theme to apply