Class TTextualStatWidget
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.widget.TClickableWidget
com.thecsdev.commonmc.api.client.gui.widget.TButtonWidget
com.thecsdev.commonmc.api.client.gui.widget.stats.TTextualStatWidget
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
- Direct Known Subclasses:
TCustomStatWidget
@Environment(CLIENT)
public sealed class TTextualStatWidget
extends TButtonWidget
permits TCustomStatWidget
Simple textual stat widget featuring two
TLabelElements showing
only the name and value of a given stat. Can be anything, you set the label texts.-
Nested Class Summary
Nested classes/interfaces inherited from class TButtonWidget
TButtonWidget.Flat, TButtonWidget.Paintable, TButtonWidget.Transparent -
Field Summary
Fields inherited from class TButtonWidget
LBL_PAD_X, LBL_PAD_YFields inherited from class TClickableWidget
eClicked, ONCLICK_SOUNDFields inherited from class TElement
eInitialized -
Constructor Summary
ConstructorsConstructorDescriptionTTextualStatWidget(@NotNull net.minecraft.network.chat.Component left, @NotNull net.minecraft.network.chat.Component right) -
Method Summary
Modifier and TypeMethodDescriptionfinal IntegerPropertyTheIntegerPropertyfor this stat widget's background color.final IntegerPropertyTheIntegerPropertyfor this stat widget's focus outline color.final TLabelElementReturns theTLabelElementholding the stat name.final TLabelElementReturns theTLabelElementholding the stat value.protected voidCallback method that is invoked when thisTElementis initializing.final IntegerPropertyTheIntegerPropertyfor this stat widget's outline color.voidpostRenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked after thisNodeand all of their children have been rendered.voidrenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked when thisNodeis being rendered.Methods inherited from class TButtonWidget
getLabelMethods inherited from class TClickableWidget
click, clickCallback, dragEndCallback, dragStartCallback, enabledProperty, focusLostCallback, getCursor, hoverGainedCallback, inputCallback, isFocusable, pressedPropertyMethods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, findElementAt, focusableProperty, focusGainedCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getSelf, getTooltip, hoverableProperty, hoverLostCallback, invalidateTooltipCache, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, tooltipProperty, toString, visiblePropertyMethods inherited from class Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Constructor Details
-
TTextualStatWidget
public TTextualStatWidget() -
TTextualStatWidget
public TTextualStatWidget(@NotNull @NotNull net.minecraft.network.chat.Component left, @NotNull @NotNull net.minecraft.network.chat.Component right)
-
-
Method Details
-
getKeyLabel
Returns theTLabelElementholding the stat name. Use this to customize the label and set its text.- API Note:
- Do not reassign this label to another parent!
-
getValueLabel
Returns theTLabelElementholding the stat value. Use this to customize the label and set its text.- API Note:
- Do not reassign this label to another parent!
-
initCallback
Description copied from class:TElementCallback method that is invoked when thisTElementis initializing. You may override this method to create and add childTElements.- Overrides:
initCallbackin classTButtonWidget- See Also:
-
backgroundColorProperty
TheIntegerPropertyfor this stat widget's background color. This color is drawn in the background of this element. -
outlineColorProperty
TheIntegerPropertyfor this stat widget's outline color. This color is drawn as the outline. -
focusOutlineColorProperty
TheIntegerPropertyfor this stat widget's focus outline color. This color is drawn as the outline when this element is focused. -
renderCallback
Description copied from interface:INodeRenderableCallback method that is invoked when thisNodeis being rendered.- Specified by:
renderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
renderCallbackin classTButtonWidget- Parameters:
pencil- The rendering context.
-
postRenderCallback
Description copied from interface:INodeRenderableCallback method that is invoked after thisNodeand all of their children have been rendered.- Specified by:
postRenderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
postRenderCallbackin classTClickableWidget- Parameters:
pencil- The rendering context.
-