GaldurLabel
classclient onlysince 0.1.0com.galdurstudio.galdurui.api.widget.GaldurLabel
Themed line of text. The widget is exactly the size of its text (or of its maximum width, the text being cut with "…"). It takes no click or focus and plays no sound, but is narrated.
column.addChild(GaldurLabel.of(Component.literal("Title")));GaldurLabel counter = column.addChild(GaldurLabel.muted(Component.literal("Clicks: 0")));counter.setText(Component.literal("Clicks: 1")); // also updates the widthpublic class GaldurLabel extends AbstractWidget
PACKAGEapi.widget
SIDEclient only
EXTENDSAbstractWidget
Constructors 1
GaldurLabel
protected2 overloadsprotected GaldurLabel(Component text, IntSupplier color)
protected GaldurLabel(Component text, IntSupplier color, int maxWidth)
PARAMETERS
textComponent—
colorIntSuppliersupplier of the ARGB text colour, called every frame
maxWidthintmaximum width in pixels, the text being cut with "…"; 0 or less for none
Methods 4
of
static2 overloadspublic static GaldurLabel of(Component text, int maxWidth)
public static GaldurLabel of(Component text)
PARAMETERS
textComponent—
maxWidthint—
RETURNSGaldurLabel — a label in text, at most maxWidth pixels wide
muted
static2 overloadspublic static GaldurLabel muted(Component text, int maxWidth)
public static GaldurLabel muted(Component text)
PARAMETERS
textComponent—
maxWidthint—
RETURNSGaldurLabel — a secondary label in text_muted, at most maxWidth pixels wide
getText
public Component getText()
RETURNSComponent — the text shown
setText
public void setText(Component text)
Changes the text and resizes the widget; re-arrange the layout if the width changed.
PARAMETERS
textComponent—