Class TStretchedTextElement
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.label.TStretchedTextElement
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
An element that renders a given text
Component such that it is
stretched to fit this element's TElement.getBounds().-
Field Summary
Fields inherited from class TElement
eInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanPropertyABooleanPropertyfor whether the text should have a 'shadow' when rendered.final NotNullProperty<net.minecraft.client.gui.Font> protected final voidCallback method that is invoked when thisTElementis initializing.final voidrenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked when thisNodeis being rendered.final @NotNull IntegerPropertyReturns theIntegerPropertythat stores the color used to render the textComponent.final @NotNull NotNullProperty<net.minecraft.network.chat.Component> Returns theNotNullPropertythat stores the textComponentto be rendered by this element.final @NotNull NotNullProperty<Point2d> Returns theNotNullPropertythat stores the scale factor used when rendering the textComponent.Methods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, inputCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, postRenderCallback, 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
-
TStretchedTextElement
public TStretchedTextElement() -
TStretchedTextElement
public TStretchedTextElement(@NotNull @NotNull net.minecraft.network.chat.Component text)
-
-
Method Details
-
textProperty
Returns theNotNullPropertythat stores the textComponentto be rendered by this element. -
fontProperty
-
textColorProperty
Returns theIntegerPropertythat stores the color used to render the textComponent. -
textScaleProperty
Returns theNotNullPropertythat stores the scale factor used when rendering the textComponent.- API Note:
- Neither axis should have its scale value set to
0!
-
dropShadowProperty
ABooleanPropertyfor whether the text should have a 'shadow' when rendered.- Since:
- 5.3.0
-
initCallback
protected final void 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 classTElement- See Also:
-
renderCallback
Description copied from interface:INodeRenderableCallback method that is invoked when thisNodeis being rendered.- Specified by:
renderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
renderCallbackin classTElement- Parameters:
pencil- The rendering context.
-