Class GuiRectangle

All Implemented Interfaces:
BackgroundRender, ElementEvents, GuiParent<GuiRectangle>, TooltipHandler<GuiRectangle>

public class GuiRectangle extends GuiElement<GuiRectangle> implements BackgroundRender
Used to draw a simple rectangle on the screen. Can specify separate (or no) border colours and fill colours. Can also render using the "shadedRectangle" render type.

Created by brandon3055 on 28/08/2023

  • Constructor Details

    • GuiRectangle

      public GuiRectangle(GuiParent<?> parent)
      Parameters:
      parent - parent GuiParent.
  • Method Details

    • vanillaSlot

      public static GuiRectangle vanillaSlot(GuiParent<?> parent)
      Creates a rectangle that mimics the appearance of a vanilla inventory slot. Uses shadedRect to create the 3D "inset" look.
    • invertedSlot

      public static GuiRectangle invertedSlot(GuiParent<?> parent)
      Creates a rectangle that mimics the appearance of a vanilla inventory slot, except inverted Uses shadedRect to create the 3D "popped out" appearance
    • planeButton

      public static GuiRectangle planeButton(GuiParent<?> parent)
      Creates a rectangle similar in appearance to a vanilla button, but with no texture and no black border.
    • toolTipBackground

      public static GuiRectangle toolTipBackground(GuiParent<?> parent)
    • toolTipBackground

      public static GuiRectangle toolTipBackground(GuiParent<?> parent, int backgroundColour, int borderColourTop, int borderColourBottom)
    • toolTipBackground

      public static GuiRectangle toolTipBackground(GuiParent<?> parent, int backgroundColourTop, int backgroundColourBottom, int borderColourTop, int borderColourBottom)
    • border

      public GuiRectangle border(int border)
    • border

      public GuiRectangle border(@Nullable @Nullable IntSupplier border)
    • fill

      public GuiRectangle fill(int fill)
    • fill

      public GuiRectangle fill(IntSupplier fill)
    • rectangle

      public GuiRectangle rectangle(int fill, int border)
    • rectangle

      public GuiRectangle rectangle(IntSupplier fill, IntSupplier border)
    • shadedRect

      public GuiRectangle shadedRect(int topLeft, int bottomRight, int fill)
    • shadedRect

      public GuiRectangle shadedRect(IntSupplier topLeft, IntSupplier bottomRight, IntSupplier fill)
    • shadedRect

      public GuiRectangle shadedRect(int topLeft, int bottomRight, int cornerMix, int fill)
    • shadedRect

      public GuiRectangle shadedRect(IntSupplier topLeft, IntSupplier bottomRight, IntSupplier cornerMix, IntSupplier fill)
    • setShadeTopLeft

      public GuiRectangle setShadeTopLeft(IntSupplier shadeTopLeft)
    • setShadeBottomRight

      public GuiRectangle setShadeBottomRight(IntSupplier shadeBottomRight)
    • setShadeCorners

      public GuiRectangle setShadeCorners(IntSupplier shadeCorners)
    • setShadeCornersAuto

      public GuiRectangle setShadeCornersAuto()
    • borderWidth

      public GuiRectangle borderWidth(double borderWidth)
    • borderWidth

      public GuiRectangle borderWidth(DoubleSupplier borderWidth)
    • getBorderWidth

      public double getBorderWidth()
    • renderBehind

      public void renderBehind(net.minecraft.client.gui.GuiGraphics render, double mouseX, double mouseY, float partialTicks)
      Description copied from interface: BackgroundRender
      Used to render content behind 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:
      renderBehind in interface BackgroundRender
      Parameters:
      render - Contains gui context information as well as essential render methods/utils including the PoseStack.