Class GuiRectangle
java.lang.Object
codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry<GuiRectangle>
codechicken.lib.gui.modular.elements.GuiElement<GuiRectangle>
codechicken.lib.gui.modular.elements.GuiRectangle
- All Implemented Interfaces:
BackgroundRender,ElementEvents,GuiParent<GuiRectangle>,TooltipHandler<GuiRectangle>
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
-
Field Summary
Fields inherited from class codechicken.lib.gui.modular.elements.GuiElement
hoverTime, initialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionborder(int border) border(@Nullable IntSupplier border) borderWidth(double borderWidth) borderWidth(DoubleSupplier borderWidth) fill(int fill) fill(IntSupplier fill) doublestatic GuiRectangleinvertedSlot(GuiParent<?> parent) Creates a rectangle that mimics the appearance of a vanilla inventory slot, except inverted Uses shadedRect to create the 3D "popped out" appearancestatic GuiRectangleplaneButton(GuiParent<?> parent) Creates a rectangle similar in appearance to a vanilla button, but with no texture and no black border.rectangle(int fill, int border) rectangle(IntSupplier fill, IntSupplier border) voidrenderBehind(net.minecraft.client.gui.GuiGraphics render, double mouseX, double mouseY, float partialTicks) Used to render content behind this elements child elements.setShadeBottomRight(IntSupplier shadeBottomRight) setShadeCorners(IntSupplier shadeCorners) setShadeTopLeft(IntSupplier shadeTopLeft) shadedRect(int topLeft, int bottomRight, int fill) shadedRect(int topLeft, int bottomRight, int cornerMix, int fill) shadedRect(IntSupplier topLeft, IntSupplier bottomRight, IntSupplier fill) shadedRect(IntSupplier topLeft, IntSupplier bottomRight, IntSupplier cornerMix, IntSupplier fill) static GuiRectangletoolTipBackground(GuiParent<?> parent) static GuiRectangletoolTipBackground(GuiParent<?> parent, int backgroundColour, int borderColourTop, int borderColourBottom) static GuiRectangletoolTipBackground(GuiParent<?> parent, int backgroundColourTop, int backgroundColourBottom, int borderColourTop, int borderColourBottom) static GuiRectanglevanillaSlot(GuiParent<?> parent) Creates a rectangle that mimics the appearance of a vanilla inventory slot.Methods inherited from class codechicken.lib.gui.modular.elements.GuiElement
addChild, addJeiDropTargets, addJeiExclusions, adoptChild, applyQueuedChildUpdates, blockMouseEvents, blockMouseOver, bringChildToForeground, font, getChildren, getJeiDropConsumer, getModularGui, getParent, getTooltip, getTooltipDelay, hoverTime, initElement, isDescendantOf, isEnabled, isJeiDropTarget, isJeiExcluded, isMouseOver, isOpaque, isRemoved, isTooltipEnabled, jeiExclude, mc, onScreenInit, removeChild, render, renderChild, renderOverlay, scaledScreenHeight, scaledScreenWidth, sendChildToBackground, sendChildToIndex, setEnabled, setEnabled, setEnableToolTip, setJeiDropTarget, setJeiExcluded, setOpaque, setRenderCull, setTooltip, setTooltipDelay, showToolTip, tick, toString, updateMouseOver, updateScreenDataMethods inherited from class codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry
addBoundsToRect, clearConstraints, clearGeometryCache, constrain, get, getChildBounds, getEnclosingRect, getParent, getPosition, getRectangle, placeInside, placeInside, placeOutside, placeOutside, setHeight, setPos, setSize, setWidth, setXPos, setYPos, strictMode, validate, xCenter, xMax, xMin, xSize, yCenter, yMax, yMin, ySizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface codechicken.lib.gui.modular.lib.ElementEvents
charTyped, charTyped, keyPressed, keyPressed, keyReleased, keyReleased, mouseClicked, mouseClicked, mouseMoved, mouseReleased, mouseReleased, mouseScrolled, mouseScrolledMethods inherited from interface codechicken.lib.gui.modular.lib.geometry.GuiParent
addChild, getValueMethods inherited from interface codechicken.lib.gui.modular.lib.TooltipHandler
renderTooltip, setTooltip, setTooltip, setTooltip, setTooltipSingle, setTooltipSingle
-
Constructor Details
-
GuiRectangle
- Parameters:
parent- parentGuiParent.
-
-
Method Details
-
vanillaSlot
Creates a rectangle that mimics the appearance of a vanilla inventory slot. Uses shadedRect to create the 3D "inset" look. -
invertedSlot
Creates a rectangle that mimics the appearance of a vanilla inventory slot, except inverted Uses shadedRect to create the 3D "popped out" appearance -
planeButton
Creates a rectangle similar in appearance to a vanilla button, but with no texture and no black border. -
toolTipBackground
-
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
-
border
-
fill
-
fill
-
rectangle
-
rectangle
-
shadedRect
-
shadedRect
-
shadedRect
-
shadedRect
public GuiRectangle shadedRect(IntSupplier topLeft, IntSupplier bottomRight, IntSupplier cornerMix, IntSupplier fill) -
setShadeTopLeft
-
setShadeBottomRight
-
setShadeCorners
-
setShadeCornersAuto
-
borderWidth
-
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:BackgroundRenderUsed to render content behind this elements child elements. When rendering element content, always use thePoseStackavailable via the providedWhere applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.invalid reference
GuiRender- Specified by:
renderBehindin interfaceBackgroundRender- Parameters:
render- Contains gui context information as well as essential render methods/utils including the PoseStack.
-