Files

68 lines
1.9 KiB
Markdown

# UILabelBaseComponent.UILabelBaseComponent
[← UILabelBaseComponent](index.md) · [← Master](../../wiki.md)
Parça 2/3 · [önceki](UILabelBaseComponent.md) · [sonraki](UILabelBaseComponent-3.md)
public UILabelBaseComponent color(int color)
Change text color of this component by providing hex RGB.
// Assuming that uiContext is a IMappetUIContext
// Set label's text color to toxic green
uiContext.get("component").color(0x00ff00);
color
public UILabelBaseComponent color(int color,
boolean shadow)
Change text color of this component by providing hex RGB. Optionally enable text shadow.
// Assuming that uiContext is a IMappetUIContext
// Set label's text color to black (and without text shadow)
uiContext.get("component").color(0x000000, false);
label
public UILabelBaseComponent label(java.lang.String label)
Set label for label, toggle and text UI components, or change the input value for textbox and textarea components.
// Assuming that uiContext is a IMappetUIContext
// Assuming that title is a label UI component
uiContext.get("title").label("Application form");
// Assuming that prerequisites is a text UI component
uiContext.get("prerequisites").label("This is an application form for enrolling into H.P. Lovecraft's book club.\n\n* - are required fields");
// Assuming that fullname is a textbox UI component
uiContext.get("fullname").label("John Smith");
// Assuming that description is a textarea UI component
uiContext.get("description").label("I'm John Smith, I'm from Alaska, and I like fishing.");
// Assuming that adult is a toggle UI component
uiContext.get("adult").label("Adult");
getLabel
protected java.lang.String getLabel()
apply
protected GuiElement apply(GuiElement element,
UIContext context)
Overrides:
apply in class UIComponent
applyProperty