Aller au contenu
galdurdocs

GaldurLabel

classclient uniquementdepuis 0.1.0

com.galdurstudio.galdurui.api.widget.GaldurLabel

Pas encore traduit : texte d’origine en anglais.

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.

Example.java
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 width
public class GaldurLabel extends AbstractWidget
PAQUETapi.widget
CÔTÉclient uniquement
HÉRITE DEAbstractWidget

Constructeurs 1

GaldurLabel

protected2 surcharges
protected GaldurLabel(Component text, IntSupplier color)
protected GaldurLabel(Component text, IntSupplier color, int maxWidth)

PARAMÈTRES

textComponent—
colorIntSuppliersupplier of the ARGB text colour, called every frame
maxWidthintmaximum width in pixels, the text being cut with "…"; 0 or less for none

Méthodes 4

of

static2 surcharges
public static GaldurLabel of(Component text, int maxWidth)
public static GaldurLabel of(Component text)

PARAMÈTRES

textComponent—
maxWidthint—

RENVOIEGaldurLabel — a label in text, at most maxWidth pixels wide

muted

static2 surcharges
public static GaldurLabel muted(Component text, int maxWidth)
public static GaldurLabel muted(Component text)

PARAMÈTRES

textComponent—
maxWidthint—

RENVOIEGaldurLabel — a secondary label in text_muted, at most maxWidth pixels wide

getText

public Component getText()

RENVOIEComponent — the text shown

setText

public void setText(Component text)

Changes the text and resizes the widget; re-arrange the layout if the width changed.

PARAMÈTRES

textComponent—
© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyProduit non officiel. Non approuvé par Mojang ou Microsoft, ni associé à eux.