Package net.minecraft.client.gui
Class DrawableHelper
java.lang.Object
net.minecraft.client.gui.DrawableHelper
- Direct Known Subclasses:
AbstractButtonWidget
,AbstractParentElement
,AdvancementTab
,AdvancementWidget
,BossBarHud
,ChatHud
,DebugHud
,InGameHud
,Overlay
,PlayerListHud
,RecipeAlternativesWidget
,RecipeBookWidget
,SpectatorHud
,SubtitlesHud
,ToastManager
@Environment(CLIENT) public abstract class DrawableHelper extends Object
-
Field Summary
Fields Modifier and Type Field Description static Identifier
GUI_ICONS_TEXTURE
The texture of various icons and widgets used for rendering ingame indicators.static Identifier
OPTIONS_BACKGROUND_TEXTURE
The texture used by options for background.static Identifier
STATS_ICON_TEXTURE
The texture of icons used in the stats screen.private int
zOffset
The z offset used byDrawableHelper
. -
Constructor Summary
Constructors Constructor Description DrawableHelper()
-
Method Summary
Modifier and Type Method Description static void
drawCenteredString(MatrixStack matrices, TextRenderer textRenderer, String text, int centerX, int y, int color)
static void
drawCenteredText(MatrixStack matrices, TextRenderer textRenderer, Text text, int centerX, int y, int color)
protected void
drawHorizontalLine(MatrixStack matrices, int x1, int x2, int y, int color)
static void
drawSprite(MatrixStack matrices, int x, int y, int z, int width, int height, Sprite sprite)
static void
drawStringWithShadow(MatrixStack matrices, TextRenderer textRenderer, String text, int x, int y, int color)
static void
drawTexture(MatrixStack matrices, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight)
Draws a textured rectangle from a region in a texture.static void
drawTexture(MatrixStack matrices, int x, int y, int z, float u, float v, int width, int height, int textureHeight, int textureWidth)
Draws a textured rectangle from a region in a texture.static void
drawTexture(MatrixStack matrices, int x, int y, int width, int height, float u, float v, int regionWidth, int regionHeight, int textureWidth, int textureHeight)
Draws a textured rectangle from a region in a texture.void
drawTexture(MatrixStack matrices, int x, int y, int u, int v, int width, int height)
Draws a textured rectangle from a region in a 256x256 texture.private static void
drawTexture(MatrixStack matrices, int x0, int y0, int x1, int y1, int z, int regionWidth, int regionHeight, float u, float v, int textureWidth, int textureHeight)
private static void
drawTexturedQuad(Matrix4f matrices, int x0, int x1, int y0, int y1, int z, float u0, float u1, float v0, float v1)
static void
drawTextWithShadow(MatrixStack matrices, TextRenderer textRenderer, Text text, int x, int y, int color)
protected void
drawVerticalLine(MatrixStack matrices, int x, int y1, int y2, int color)
static void
fill(MatrixStack matrices, int x1, int y1, int x2, int y2, int color)
private static void
fill(Matrix4f matrix, int x1, int y1, int x2, int y2, int color)
protected void
fillGradient(MatrixStack matrices, int xStart, int yStart, int xEnd, int yEnd, int colorStart, int colorEnd)
protected static void
fillGradient(Matrix4f matrix, BufferBuilder bufferBuilder, int xStart, int yStart, int xEnd, int yEnd, int z, int colorStart, int colorEnd)
int
getZOffset()
void
method_29343(int int2, int int3, BiConsumer<Integer,Integer> biConsumer)
void
setZOffset(int zOffset)
-
Field Details
-
OPTIONS_BACKGROUND_TEXTURE
The texture used by options for background. -
STATS_ICON_TEXTURE
The texture of icons used in the stats screen. -
GUI_ICONS_TEXTURE
The texture of various icons and widgets used for rendering ingame indicators. -
zOffset
private int zOffsetThe z offset used byDrawableHelper
.
-
-
Constructor Details
-
DrawableHelper
public DrawableHelper()
-
-
Method Details
-
drawHorizontalLine
-
drawVerticalLine
-
fill
-
fill
-
fillGradient
protected void fillGradient(MatrixStack matrices, int xStart, int yStart, int xEnd, int yEnd, int colorStart, int colorEnd) -
fillGradient
protected static void fillGradient(Matrix4f matrix, BufferBuilder bufferBuilder, int xStart, int yStart, int xEnd, int yEnd, int z, int colorStart, int colorEnd) -
drawCenteredString
public static void drawCenteredString(MatrixStack matrices, TextRenderer textRenderer, String text, int centerX, int y, int color) -
drawCenteredText
public static void drawCenteredText(MatrixStack matrices, TextRenderer textRenderer, Text text, int centerX, int y, int color) -
drawStringWithShadow
public static void drawStringWithShadow(MatrixStack matrices, TextRenderer textRenderer, String text, int x, int y, int color) -
drawTextWithShadow
public static void drawTextWithShadow(MatrixStack matrices, TextRenderer textRenderer, Text text, int x, int y, int color) -
method_29343
-
drawSprite
public static void drawSprite(MatrixStack matrices, int x, int y, int z, int width, int height, Sprite sprite) -
drawTexture
Draws a textured rectangle from a region in a 256x256 texture.The Z coordinate of the rectangle is
zOffset
.The width and height of the region are the same as the dimensions of the rectangle.
- Parameters:
matrices
- the matrix stack used for renderingx
- the X coordinate of the rectangley
- the Y coordinate of the rectangleu
- the left-most coordinate of the texture regionv
- the top-most coordinate of the texture regionwidth
- the widthheight
- the height
-
drawTexture
public static void drawTexture(MatrixStack matrices, int x, int y, int z, float u, float v, int width, int height, int textureHeight, int textureWidth)Draws a textured rectangle from a region in a texture.The width and height of the region are the same as the dimensions of the rectangle.
- Parameters:
matrices
- the matrix stack used for renderingx
- the X coordinate of the rectangley
- the Y coordinate of the rectanglez
- the Z coordinate of the rectangleu
- the left-most coordinate of the texture regionv
- the top-most coordinate of the texture regionwidth
- the width of the rectangleheight
- the height of the rectangletextureHeight
- the height of the entire texturetextureWidth
- the width of the entire texture
-
drawTexture
public static void drawTexture(MatrixStack matrices, int x, int y, int width, int height, float u, float v, int regionWidth, int regionHeight, int textureWidth, int textureHeight)Draws a textured rectangle from a region in a texture.- Parameters:
matrices
- the matrix stack used for renderingx
- the X coordinate of the rectangley
- the Y coordinate of the rectanglewidth
- the width of the rectangleheight
- the height of the rectangleu
- the left-most coordinate of the texture regionv
- the top-most coordinate of the texture regionregionWidth
- the width of the texture regionregionHeight
- the height of the texture regiontextureWidth
- the width of the entire texturetextureHeight
- the height of the entire texture
-
drawTexture
public static void drawTexture(MatrixStack matrices, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight)Draws a textured rectangle from a region in a texture.The width and height of the region are the same as the dimensions of the rectangle.
- Parameters:
matrices
- the matrix stack used for renderingx
- the X coordinate of the rectangley
- the Y coordinate of the rectangleu
- the left-most coordinate of the texture regionv
- the top-most coordinate of the texture regionwidth
- the width of the rectangleheight
- the height of the rectangletextureWidth
- the width of the entire texturetextureHeight
- the height of the entire texture
-
drawTexture
private static void drawTexture(MatrixStack matrices, int x0, int y0, int x1, int y1, int z, int regionWidth, int regionHeight, float u, float v, int textureWidth, int textureHeight) -
drawTexturedQuad
private static void drawTexturedQuad(Matrix4f matrices, int x0, int x1, int y0, int y1, int z, float u0, float u1, float v0, float v1) -
getZOffset
public int getZOffset() -
setZOffset
public void setZOffset(int zOffset)
-