Table of Contents

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

text string

The text to display

fontSize int

The size of the font

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

alignment AnchorType

The alignment to use

SetColor(Color)

Set the color of the text on this label.

public void SetColor(Color color)

Parameters

color Color

The color to set

SetText(string)

Sets the text on this label.

public void SetText(string text)

Parameters

text string

The 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

theme Theme

The theme to apply