Class TLabelElement
java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.TElement
io.github.thecsdev.tcdcommons.api.client.gui.other.TBlankElement
io.github.thecsdev.tcdcommons.api.client.gui.other.TLabelElement
- All Implemented Interfaces:
TParentElement
,ITooltipProvider
,IEnableStateProvider
,ITextProvider
,ITextProviderSetter
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
TElement.TElementEvent_ChildAR, TElement.TElementEvent_ContextMenu, TElement.TElementEvent_Moved, TElement.TElementEvent_ParentChanged, TElement.TElementEvent_Resized
-
Field Summary
Modifier and TypeFieldDescriptionprotected @Nullable net.minecraft.text.Text
protected int
protected HorizontalAlignment
protected float
protected int
Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
alpha, eChildAdded, eChildRemoved, eContextMenu, eMoved, eParentChanged, eResized, height, SP_ALL, SP_INVOKE_EVENT, SP_MOVE_CHILDREN, SP_RELATIVE, SP_UPDATE_TOPMOST, SS_ALL, SS_INVOKE_EVENT, SS_UPDATE_TOPMOST, tooltip, tooltipPositioner, width, x, y, zOffset
Fields inherited from interface io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
MAX_CHILD_NESTING_DEPTH
-
Constructor Summary
ConstructorDescriptionTLabelElement
(int x, int y, int width, int height) TLabelElement
(int x, int y, int width, int height, net.minecraft.text.Text text) -
Method Summary
Modifier and TypeMethodDescriptionfinal net.minecraft.text.Text
getText()
final int
final HorizontalAlignment
final float
final int
void
render
(TDrawContext pencil) Renders this GUI element on the screen.void
setText
(net.minecraft.text.Text text) void
setTextColor
(int color) void
setTextHorizontalAlignment
(HorizontalAlignment alignment) void
setTextScale
(float textScale) void
setTextSideOffset
(int textSideOffset) Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.other.TBlankElement
input, input, isFocusable, isHoverable
Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
canBeAddedTo, createContextMenu, getAlpha, getChildren, getEnabled, getHeight, getItemRenderer, getParent, getParentTElement, getParentTScreen, getTextRenderer, getTooltip, getTooltipPositioner, getWidth, getX, getY, getZIndex, getZOffset, isDragging, isEnabled, isEnabledAndVisible, isFocused, isFocusedOrHovered, isHovered, isVisible, move, moveChildren, next, postRender, previous, setAlpha, setPosition, setPosition, setSize, setSize, setTooltip, setZOffset, tick, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
addChild, addChild, clearChildren, findChild, findLastChild, findParent, findParentTElement, forEachChild, getEndX, getEndY, removeChild, removeChild
-
Field Details
-
text
@Nullable protected @Nullable net.minecraft.text.Text text -
textHorizontalAlignment
-
textColor
protected int textColor -
textSideOffset
protected int textSideOffset -
textScale
protected float textScale
-
-
Constructor Details
-
TLabelElement
public TLabelElement(int x, int y, int width, int height) -
TLabelElement
public TLabelElement(int x, int y, int width, int height, net.minecraft.text.Text text)
-
-
Method Details
-
getText
public final net.minecraft.text.Text getText()- Specified by:
getText
in interfaceITextProvider
-
setText
public void setText(net.minecraft.text.Text text) - Specified by:
setText
in interfaceITextProviderSetter
-
getTextHorizontalAlignment
-
setTextHorizontalAlignment
-
getTextColor
public final int getTextColor() -
setTextColor
public void setTextColor(int color) -
getTextSideOffset
public final int getTextSideOffset() -
setTextSideOffset
public void setTextSideOffset(int textSideOffset) -
getTextScale
public final float getTextScale() -
setTextScale
public void setTextScale(float textScale) -
render
Description copied from interface:TParentElement
Renders this GUI element on the screen.- Specified by:
render
in interfaceTParentElement
- Overrides:
render
in classTBlankElement
- Parameters:
pencil
- TheTDrawContext
.
-