LabelWidget
LabelWidget
is used to display text and component.
Advanced Widget
LabelWidget
is a light-weight widget to display text only. text height, align, ... are fixed.
Therefore, we reconmend to use the TextTextureWidget
instead, which provids advanced controll of text display.
Basic Properties
Field | Description |
---|---|
color |
The text color as an integer |
dropShadow |
Indicates whether the drop shadow effect is enabled |
lastTextValue |
currently text read only |
APIs
setText()
Updates the label text with a string
.
setComponent()
Same as setText()
but support component
as input
setTextProvider()
Configures a supplier to dynamically provide the label text. It will obtain the latest text per tick.
setColor()
Sets the text color. If a rich text component is already set, its style will be replaced accordingly.
setDropShadow()
Enables or disables the drop shadow effect for the label.