66 lines
1.8 KiB
Markdown
66 lines
1.8 KiB
Markdown
# UITextComponent.textAnchor
|
|
|
|
[← UITextComponent](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 1/2 · [sonraki](textAnchor-2.md)
|
|
|
|
textAnchor(float anchor)
|
|
UITextComponent Change text's anchor point which determines where text will be rendered relative to component's frame horizontally.
|
|
|
|
Methods inherited from class mchorse.mappet.api.ui.components.UILabelBaseComponent
|
|
apply, color, color, getLabel, label
|
|
|
|
Methods inherited from class mchorse.mappet.api.ui.components.UIComponent
|
|
anchor, anchor, anchorX, anchorY, applyKeybinds, change, clearChanges, context, context, createContext, enabled, getChanges, getChildComponents, getDefaultUpdateDelay, h, handleChanges,
|
|
id, isDataReserved, keybind, keybind, keybind, keybind, margin, marginBottom, marginLeft, marginRight, marginTop, populateData, resetContext, rh, rh, rw, rw, rwh, rx, rx, rxy, ry, ry,
|
|
serializeNBT, tooltip, tooltip, updateDelay, visible, w, wh, x, xy, y
|
|
|
|
Methods inherited from class java.lang.Object
|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
|
|
|
Field Detail
|
|
textAnchor
|
|
|
|
public float textAnchor
|
|
|
|
Constructor Detail
|
|
|
|
|
|
|
|
UITextComponent
|
|
|
|
public UITextComponent()
|
|
|
|
Method Detail
|
|
textAnchor
|
|
|
|
public UITextComponent textAnchor(float anchor)
|
|
|
|
Change text's anchor point which determines where text will be rendered relative to component's frame horizontally.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
|
|
// Position the text's content in the center of its frame
|
|
uiContext.get("text").textAnchor(0.5);
|
|
|
|
|
|
create
|
|
|
|
public GuiElement create(Minecraft mc,
|
|
UIContext context)
|
|
|
|
Specified by:
|
|
create in class UIComponent
|
|
|
|
applyProperty
|
|
|
|
protected void applyProperty(UIContext context,
|
|
java.lang.String key,
|
|
GuiElement element)
|
|
|
|
Overrides:
|
|
applyProperty in class UILabelBaseComponent
|
|
|
|
serializeNBT
|
|
|