Class GuiTextList

All Implemented Interfaces:
ElementEvents, ForegroundRender, GuiParent<GuiTextList>, TooltipHandler<GuiTextList>

public class GuiTextList extends GuiElement<GuiTextList> implements ForegroundRender
Created by brandon3055 on 10/10/2023
  • Constructor Details

    • GuiTextList

      public GuiTextList(GuiParent<?> parent)
      Parameters:
      parent - parent GuiParent.
    • GuiTextList

      public GuiTextList(GuiParent<?> parent, List<? extends net.minecraft.network.chat.Component> text)
      Parameters:
      parent - parent GuiParent.
    • GuiTextList

      public GuiTextList(GuiParent<?> parent, Supplier<List<? extends net.minecraft.network.chat.Component>> text)
      Parameters:
      parent - parent GuiParent.
  • Method Details

    • autoHeight

      public GuiTextList autoHeight()
      Apply a dynamic height constraint that sets the height based on text height (accounting for wrapping)
    • setTextSupplier

      public GuiTextList setTextSupplier(Supplier<List<? extends net.minecraft.network.chat.Component>> textSupplier)
    • setText

      public GuiTextList setText(List<? extends net.minecraft.network.chat.Component> text)
    • getText

      public List<? extends net.minecraft.network.chat.Component> getText()
    • setHorizontalAlign

      public GuiTextList setHorizontalAlign(Align horizontalAlign)
    • setVerticalAlign

      public GuiTextList setVerticalAlign(Align verticalAlign)
    • getHorizontalAlign

      public Align getHorizontalAlign()
    • getVerticalAlign

      public Align getVerticalAlign()
    • setLineSpacing

      public GuiTextList setLineSpacing(int lineSpacing)
    • getLineSpacing

      public int getLineSpacing()
    • setScroll

      public GuiTextList 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. Setting this to true will automatically disable trim and wrap ether are enabled.
    • getScroll

      public boolean getScroll()
    • setShadow

      public GuiTextList setShadow(Supplier<Boolean> shadow)
    • setShadow

      public GuiTextList setShadow(boolean shadow)
    • getShadow

      public boolean getShadow()
    • setTextColour

      public GuiTextList setTextColour(Supplier<Integer> textColour)
    • setTextColour

      public GuiTextList setTextColour(int textColour)
    • getTextColour

      public int getTextColour()
    • renderInFront

      public void renderInFront(net.minecraft.client.gui.GuiGraphics render, double mouseX, double mouseY, float partialTicks)
      Description copied from interface: ForegroundRender
      Used to render content in front of this elements child elements. When rendering element content, always use the PoseStack available via the provided
      invalid reference
      GuiRender
      Where applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.
      Specified by:
      renderInFront in interface ForegroundRender
      Parameters:
      render - Contains gui context information as well as essential render methods/utils including the PoseStack.