Class Box


public class Box extends UIElement<Box>
A flexbox-like container element that lays out children in a row or column. Supports flex direction, justify-content, align-items, gap, padding, margin, background color, and absolute/relative positioning.
  • Constructor Details

    • Box

      public Box()
  • Method Details

    • direction

      public Box direction(FlexDirection dir)
    • justify

      public Box justify(JustifyContent jc)
    • alignItems

      public Box alignItems(AlignItems ai)
    • gap

      public Box gap(int g)
    • backgroundColor

      public Box backgroundColor(int color)
    • child

      public Box child(UIElement<?> child)
    • children

      public Box children(UIElement<?>... kids)
    • getChildren

      public List<UIElement<?>> getChildren()
    • measure

      public void measure(net.minecraft.client.gui.Font font)
      Description copied from class: UIElement
      Measure this element's intrinsic size. After calling, computedWidth and computedHeight are set.
      Specified by:
      measure in class UIElement<Box>
    • layout

      public void layout(int x, int y)
      Description copied from class: UIElement
      Set this element's final position and lay out children. Called by the parent after computing where this element should go.
      Overrides:
      layout in class UIElement<Box>
    • render

      public void render(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font)
      Description copied from class: UIElement
      Render this element using its computed layout coordinates.
      Specified by:
      render in class UIElement<Box>