Class GuiTextList
java.lang.Object
codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry<GuiTextList>
codechicken.lib.gui.modular.elements.GuiElement<GuiTextList>
codechicken.lib.gui.modular.elements.GuiTextList
- All Implemented Interfaces:
ElementEvents,ForegroundRender,GuiParent<GuiTextList>,TooltipHandler<GuiTextList>
Created by brandon3055 on 10/10/2023
-
Field Summary
Fields inherited from class codechicken.lib.gui.modular.elements.GuiElement
hoverTime, initialized -
Constructor Summary
ConstructorsConstructorDescriptionGuiTextList(@NotNull GuiParent<?> parent) GuiTextList(@NotNull GuiParent<?> parent, @NotNull Supplier<List<? extends net.minecraft.network.chat.Component>> text) GuiTextList(@NotNull GuiParent<?> parent, List<? extends net.minecraft.network.chat.Component> text) -
Method Summary
Modifier and TypeMethodDescriptionApply a dynamic height constraint that sets the height based on text height (accounting for wrapping)doubleSpecifies the z depth of the foreground content.intbooleanbooleanList<? extends net.minecraft.network.chat.Component> getText()intvoidrenderForeground(GuiRender render, double mouseX, double mouseY, float partialTicks) Used to render content in front of this elements child elements.setHorizontalAlign(Align horizontalAlign) setLineSpacing(int lineSpacing) setScroll(boolean scroll) Set to true the text scroll using the same logic as vanillas widgets if the text is too long to fit within the elements bounds Default enabled.setShadow(boolean shadow) setTextColour(int textColour) setTextColour(Supplier<Integer> textColour) setTextSupplier(@NotNull Supplier<List<? extends net.minecraft.network.chat.Component>> textSupplier) setVerticalAlign(Align verticalAlign) Methods inherited from class codechicken.lib.gui.modular.elements.GuiElement
addChild, addJeiDropTargets, addJeiExclusions, adoptChild, applyQueuedChildUpdates, blockMouseEvents, blockMouseOver, bringChildToForeground, font, getChildren, getCombinedElementDepth, getJeiDropConsumer, getModularGui, getParent, getTooltip, getTooltipDelay, hoverTime, initElement, isDescendantOf, isEnabled, isJeiDropTarget, isJeiExcluded, isMouseOver, isOpaque, isRemoved, isTooltipEnabled, jeiExclude, mc, onScreenInit, removeChild, render, renderChild, renderOverlay, scaledScreenHeight, scaledScreenWidth, sendChildToBackground, sendChildToIndex, setEnabled, setEnabled, setEnableToolTip, setJeiDropTarget, setJeiExcluded, setOpaque, setRenderCull, setTooltip, setTooltipDelay, setZStacking, showToolTip, tick, toString, updateMouseOver, updateScreenData, zStackingMethods inherited from class codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry
addBoundsToRect, clearConstraints, clearGeometryCache, constrain, get, getChildBounds, getEnclosingRect, getParent, getPosition, getRectangle, placeInside, placeInside, placeOutside, placeOutside, setHeight, setPos, setSize, setWidth, setXPos, setYPos, strictMode, validate, xCenter, xMax, xMin, xSize, yCenter, yMax, yMin, ySizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface codechicken.lib.gui.modular.lib.ElementEvents
charTyped, charTyped, keyPressed, keyPressed, keyReleased, keyReleased, mouseClicked, mouseClicked, mouseMoved, mouseReleased, mouseReleased, mouseScrolled, mouseScrolledMethods inherited from interface codechicken.lib.gui.modular.lib.geometry.GuiParent
addChild, getValueMethods inherited from interface codechicken.lib.gui.modular.lib.TooltipHandler
renderTooltip, setTooltip, setTooltip, setTooltip, setTooltipSingle, setTooltipSingle
-
Constructor Details
-
GuiTextList
- Parameters:
parent- parentGuiParent.
-
GuiTextList
public GuiTextList(@NotNull @NotNull GuiParent<?> parent, List<? extends net.minecraft.network.chat.Component> text) - Parameters:
parent- parentGuiParent.
-
GuiTextList
public GuiTextList(@NotNull @NotNull GuiParent<?> parent, @NotNull @NotNull Supplier<List<? extends net.minecraft.network.chat.Component>> text) - Parameters:
parent- parentGuiParent.
-
-
Method Details
-
autoHeight
Apply a dynamic height constraint that sets the height based on text height (accounting for wrapping) -
setTextSupplier
public GuiTextList setTextSupplier(@NotNull @NotNull Supplier<List<? extends net.minecraft.network.chat.Component>> textSupplier) -
setText
-
getText
-
setHorizontalAlign
-
setVerticalAlign
-
getHorizontalAlign
-
getVerticalAlign
-
setLineSpacing
-
getLineSpacing
public int getLineSpacing() -
setScroll
Set to true the text scroll using the same logic as vanillas widgets if the text is too long to fit within the elements bounds Default enabled. Setting this to true will automatically disable trim and wrap ether are enabled. -
getScroll
public boolean getScroll() -
setShadow
-
setShadow
-
getShadow
public boolean getShadow() -
setTextColour
-
setTextColour
-
getTextColour
public int getTextColour() -
getForegroundDepth
public double getForegroundDepth()Description copied from interface:ForegroundRenderSpecifies the z depth of the foreground content. Used when calculating the total depth of this gui element. Recommended minimum depth is 0.01 or 0.035 if this element renders text. (text shadows are rendered with a 0.03 offset)- Specified by:
getForegroundDepthin interfaceForegroundRender- Returns:
- the z height of the background content.
-
renderForeground
Description copied from interface:ForegroundRenderUsed to render content in front of this elements child elements. When rendering element content, always use thePoseStackavailable via the providedGuiRenderWhere applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.- Specified by:
renderForegroundin interfaceForegroundRender- Parameters:
render- Contains gui context information as well as essential render methods/utils including the PoseStack.
-