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(@NotNull @NotNull GuiParent<?> parent)
      Parameters:
      parent - parent GuiParent.
  • Method Details

    • vanillaSlot

      public static GuiRectangle vanillaSlot(@NotNull @NotNull 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(@NotNull @NotNull 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(@NotNull @NotNull 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(@NotNull @NotNull GuiParent<?> parent)
    • toolTipBackground

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

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

      public GuiRectangle border(int border)
    • border

      public GuiRectangle border(Supplier<Integer> border)
    • fill

      public GuiRectangle fill(int fill)
    • fill

      public GuiRectangle fill(Supplier<Integer> fill)
    • rectangle

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

      public GuiRectangle rectangle(Supplier<Integer> fill, Supplier<Integer> border)
    • shadedRect

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

      public GuiRectangle shadedRect(Supplier<Integer> topLeft, Supplier<Integer> bottomRight, Supplier<Integer> fill)
    • shadedRect

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

      public GuiRectangle shadedRect(Supplier<Integer> topLeft, Supplier<Integer> bottomRight, Supplier<Integer> cornerMix, Supplier<Integer> fill)
    • setShadeTopLeft

      public GuiRectangle setShadeTopLeft(Supplier<Integer> shadeTopLeft)
    • setShadeBottomRight

      public GuiRectangle setShadeBottomRight(Supplier<Integer> shadeBottomRight)
    • setShadeCorners

      public GuiRectangle setShadeCorners(Supplier<Integer> shadeCorners)
    • setShadeCornersAuto

      public GuiRectangle setShadeCornersAuto()
    • borderWidth

      public GuiRectangle borderWidth(double borderWidth)
    • borderWidth

      public GuiRectangle borderWidth(Supplier<Double> borderWidth)
    • getBorderWidth

      public double getBorderWidth()
    • renderBackground

      public void renderBackground(GuiRender 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 GuiRender Where applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.
      Specified by:
      renderBackground in interface BackgroundRender
      Parameters:
      render - Contains gui context information as well as essential render methods/utils including the PoseStack.