Class UIElement<T extends UIElement<T>>

java.lang.Object
me.hackware.api.gui.layout.UIElement<T>
Direct Known Subclasses:
Box, PlayerHead, Text

public abstract class UIElement<T extends UIElement<T>> extends Object
Base class for all UI elements in the flexbox-like layout system. Uses a self-referential generic for fluent builder chaining on subclasses.
  • Field Details

    • paddingTop

      protected int paddingTop
    • paddingRight

      protected int paddingRight
    • paddingBottom

      protected int paddingBottom
    • paddingLeft

      protected int paddingLeft
    • marginTop

      protected int marginTop
    • marginRight

      protected int marginRight
    • marginBottom

      protected int marginBottom
    • marginLeft

      protected int marginLeft
    • position

      protected Position position
    • posTop

      protected int posTop
    • posRight

      protected int posRight
    • posBottom

      protected int posBottom
    • posLeft

      protected int posLeft
    • fixedWidth

      protected int fixedWidth
    • fixedHeight

      protected int fixedHeight
  • Constructor Details

    • UIElement

      public UIElement()
  • Method Details

    • padding

      public T padding(int all)
    • padding

      public T padding(int vertical, int horizontal)
    • padding

      public T padding(int top, int right, int bottom, int left)
    • paddingTop

      public T paddingTop(int v)
    • paddingRight

      public T paddingRight(int v)
    • paddingBottom

      public T paddingBottom(int v)
    • paddingLeft

      public T paddingLeft(int v)
    • margin

      public T margin(int all)
    • margin

      public T margin(int vertical, int horizontal)
    • margin

      public T margin(int top, int right, int bottom, int left)
    • marginTop

      public T marginTop(int v)
    • marginRight

      public T marginRight(int v)
    • marginBottom

      public T marginBottom(int v)
    • marginLeft

      public T marginLeft(int v)
    • position

      public T position(Position pos)
    • top

      public T top(int v)
    • right

      public T right(int v)
    • bottom

      public T bottom(int v)
    • left

      public T left(int v)
    • width

      public T width(int w)
    • height

      public T height(int h)
    • size

      public T size(int w, int h)
    • measure

      public abstract void measure(net.minecraft.client.gui.Font font)
      Measure this element's intrinsic size. After calling, computedWidth and computedHeight are set.
    • layout

      public void layout(int x, int y)
      Set this element's final position and lay out children. Called by the parent after computing where this element should go.
    • render

      public abstract void render(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font)
      Render this element using its computed layout coordinates.