Class GuiRectangle
java.lang.Object
codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry<T>
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) borderWidth(double borderWidth) borderWidth(Supplier<Double> borderWidth) fill(int fill) doublestatic GuiRectangleinvertedSlot(@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" appearancestatic GuiRectangleplaneButton(@NotNull 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) voidrenderBackground(GuiRender render, double mouseX, double mouseY, float partialTicks) Used to render content behind this elements child elements.setShadeBottomRight(Supplier<Integer> shadeBottomRight) setShadeCorners(Supplier<Integer> shadeCorners) setShadeTopLeft(Supplier<Integer> shadeTopLeft) shadedRect(int topLeft, int bottomRight, int fill) shadedRect(int topLeft, int bottomRight, int cornerMix, int fill) shadedRect(Supplier<Integer> topLeft, Supplier<Integer> bottomRight, Supplier<Integer> cornerMix, Supplier<Integer> fill) static GuiRectangletoolTipBackground(@NotNull GuiParent<?> parent) static GuiRectangletoolTipBackground(@NotNull GuiParent<?> parent, int backgroundColour, int borderColourTop, int borderColourBottom) static GuiRectangletoolTipBackground(@NotNull GuiParent<?> parent, int backgroundColourTop, int backgroundColourBottom, int borderColourTop, int borderColourBottom) static GuiRectanglevanillaSlot(@NotNull 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, getCombinedElementDepth, 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, setZStacking, showToolTip, tick, toString, updateMouseOver, updateScreenData, zStackingMethods 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.BackgroundRender
getBackgroundDepthMethods 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(@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
-
border
-
fill
-
fill
-
rectangle
-
rectangle
-
shadedRect
-
shadedRect
-
shadedRect
-
shadedRect
-
setShadeTopLeft
-
setShadeBottomRight
-
setShadeCorners
-
setShadeCornersAuto
-
borderWidth
-
borderWidth
-
getBorderWidth
public double getBorderWidth() -
renderBackground
Description copied from interface:BackgroundRenderUsed to render content behind this elements child elements. When rendering element content, always use thePoseStackavailable via the providedGuiRenderWhere applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.- Specified by:
renderBackgroundin interfaceBackgroundRender- Parameters:
render- Contains gui context information as well as essential render methods/utils including the PoseStack.
-