Package net.minecraftforge.client.gui
Class GuiUtils
java.lang.Object
net.minecraftforge.client.gui.GuiUtils
This class provides several methods and constants used by the Config GUI classes.
- Author:
- bspkrs
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
drawContinuousTexturedBox
(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.static void
drawContinuousTexturedBox
(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.static void
drawContinuousTexturedBox
(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.static void
drawContinuousTexturedBox
(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.static void
drawGradientRect
(Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) static void
drawInscribedRect
(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight) static void
drawInscribedRect
(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY) static void
drawTexturedModalRect
(PoseStack poseStack, int x, int y, int u, int v, int width, int height, float zLevel) static int
getColorCode
(char c, boolean isLighter)
-
Field Details
-
DEFAULT_BACKGROUND_COLOR
public static final int DEFAULT_BACKGROUND_COLOR- See Also:
-
DEFAULT_BORDER_COLOR_START
public static final int DEFAULT_BORDER_COLOR_START- See Also:
-
DEFAULT_BORDER_COLOR_END
public static final int DEFAULT_BORDER_COLOR_END- See Also:
-
UNDO_CHAR
- See Also:
-
RESET_CHAR
- See Also:
-
VALID
- See Also:
-
INVALID
- See Also:
-
colorCodes
public static int[] colorCodes
-
-
Constructor Details
-
GuiUtils
public GuiUtils()
-
-
Method Details
-
getColorCode
public static int getColorCode(char c, boolean isLighter) -
drawContinuousTexturedBox
public static void drawContinuousTexturedBox(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. It is assumed that the desired texture ResourceLocation object has been bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).- Parameters:
poseStack
- the gui pose stackx
- x axis offsety
- y axis offsetu
- bound resource location image x offsetv
- bound resource location image y offsetwidth
- the desired box widthheight
- the desired box heighttextureWidth
- the width of the box texture in the resource location imagetextureHeight
- the height of the box texture in the resource location imageborderSize
- the size of the box's borderszLevel
- the zLevel to draw at
-
drawContinuousTexturedBox
public static void drawContinuousTexturedBox(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. The provided ResourceLocation object will be bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).- Parameters:
poseStack
- the gui pose stackres
- the ResourceLocation object that contains the desired imagex
- x axis offsety
- y axis offsetu
- bound resource location image x offsetv
- bound resource location image y offsetwidth
- the desired box widthheight
- the desired box heighttextureWidth
- the width of the box texture in the resource location imagetextureHeight
- the height of the box texture in the resource location imageborderSize
- the size of the box's borderszLevel
- the zLevel to draw at
-
drawContinuousTexturedBox
public static void drawContinuousTexturedBox(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. The provided ResourceLocation object will be bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).- Parameters:
poseStack
- the gui pose stackres
- the ResourceLocation object that contains the desired imagex
- x axis offsety
- y axis offsetu
- bound resource location image x offsetv
- bound resource location image y offsetwidth
- the desired box widthheight
- the desired box heighttextureWidth
- the width of the box texture in the resource location imagetextureHeight
- the height of the box texture in the resource location imagetopBorder
- the size of the box's top borderbottomBorder
- the size of the box's bottom borderleftBorder
- the size of the box's left borderrightBorder
- the size of the box's right borderzLevel
- the zLevel to draw at
-
drawContinuousTexturedBox
public static void drawContinuousTexturedBox(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. It is assumed that the desired texture ResourceLocation object has been bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).- Parameters:
poseStack
- the gui pose stackx
- x axis offsety
- y axis offsetu
- bound resource location image x offsetv
- bound resource location image y offsetwidth
- the desired box widthheight
- the desired box heighttextureWidth
- the width of the box texture in the resource location imagetextureHeight
- the height of the box texture in the resource location imagetopBorder
- the size of the box's top borderbottomBorder
- the size of the box's bottom borderleftBorder
- the size of the box's left borderrightBorder
- the size of the box's right borderzLevel
- the zLevel to draw at
-
drawTexturedModalRect
public static void drawTexturedModalRect(PoseStack poseStack, int x, int y, int u, int v, int width, int height, float zLevel) -
drawGradientRect
public static void drawGradientRect(Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) -
drawInscribedRect
public static void drawInscribedRect(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight) -
drawInscribedRect
public static void drawInscribedRect(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)
-