Package info.u_team.u_team_core.util
Class RenderUtil
java.lang.Object
info.u_team.u_team_core.util.RenderUtil
Utility methods for rendering
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Extended matrix that adds getters and setters for all matrix values -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addColoredQuad
(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, RGBA color, float blitOffset) Adds a quad to the buffer builder.static void
addQuad
(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float blitOffset) Adds a quad to the buffer builder.static void
addTexturedQuad
(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset) Adds a textured quad to the buffer builder.static void
addTexturedRect
(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int u, int v, float uScale, float vScale, int width, int height, float blitOffset) Adds a textured rectangle to the buffer builder.static void
drawContainerBorder
(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, RGBA color) Draws the default container borderstatic void
drawContinuousTexturedBox
(com.mojang.blaze3d.vertex.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 blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color) 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
drawTexturedQuad
(com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color) Draws a textured quad.static void
drawTexturedQuad
(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, RGBA color) Draws a textured quad.static void
drawTexturedQuad
(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int uWidth, int vHeight, float uOffset, float vOffset, int textureWidth, int textureHeight, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color) Draws a textured quad.static void
setShaderColor
(RGBA rgba) Sets the shader color fromRGBA
type
-
Field Details
-
DARK_CONTAINER_BORDER_COLOR
-
MEDIUM_CONTAINER_BORDER_COLOR
-
BRIGHT_CONTAINER_BORDER_COLOR
-
-
Constructor Details
-
RenderUtil
public RenderUtil()
-
-
Method Details
-
drawContainerBorder
public static void drawContainerBorder(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, RGBA color) Draws the default container border- Parameters:
poseStack
- Pose stackx
- X coordinatey
- Y coordinatewidth
- Widthheight
- HeightblitOffset
- zLevel for drawingcolor
- The shader color. If usingRGBA.WHITE
then the drawing will not be colored
-
drawContinuousTexturedBox
public static void drawContinuousTexturedBox(com.mojang.blaze3d.vertex.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 blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color) 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.- Parameters:
poseStack
- Pose stackx
- X coordinatey
- Y coordinateu
- U coordinatev
- V coordinatewidth
- Widthheight
- HeighttextureWidth
- Texture widthtextureHeight
- Texture heighttopBorder
- Top borderbottomBorder
- Bottom borderleftBorder
- Left borderrightBorder
- Right borderblitOffset
- zLevel for drawingtexture
- Texture locationcolor
- The shader color. If usingRGBA.WHITE
then the image will not be colored
-
drawTexturedQuad
public static void drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int uWidth, int vHeight, float uOffset, float vOffset, int textureWidth, int textureHeight, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color) Draws a textured quad.- Parameters:
poseStack
- Pose stackx
- X coordinatey
- Y coordinatewidth
- Widthheight
- HeightuWidth
- U WidthvHeight
- V HeightuOffset
- U OffsetvOffset
- V OffsettextureWidth
- Texture widthtextureHeight
- Texture heightblitOffset
- zLevel for drawingtexture
- Texture locationcolor
- The shader color. If usingRGBA.WHITE
then the image will not be colored
-
drawTexturedQuad
public static void drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, RGBA color) Draws a textured quad.- Parameters:
poseStack
- Pose stackx
- X coordinatey
- Y coordinatewidth
- Widthheight
- HeightblitOffset
- zLevel for drawingsprite
- Texture sprite from texture atlascolor
- The shader color. If usingRGBA.WHITE
then the image will not be colored
-
drawTexturedQuad
public static void drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color) Draws a textured quad.- Parameters:
poseStack
- Pose stackx1
- X1 coordinatex2
- X2 coordinatey1
- Y1 coordinatey2
- Y2 coordinateu1
- U1 coordinateu2
- U2 coordinatev1
- V1 coordinatev2
- V2 coordinateblitOffset
- zLevel for drawingtexture
- Texture locationcolor
- The shader color. If usingRGBA.WHITE
then the image will not be colored
-
addTexturedRect
public static void addTexturedRect(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int u, int v, float uScale, float vScale, int width, int height, float blitOffset) Adds a textured rectangle to the buffer builder. The vertex format must beDefaultVertexFormat.POSITION_TEX
and the draw format must beVertexFormat.Mode.QUADS
- Parameters:
bufferBuilder
- Buffer builderposeStack
- Pose stackx
- X coordinatey
- Y coordinateu
- U coordinatev
- V coordinateuScale
- U scalevScale
- V scalewidth
- Widthheight
- HeightblitOffset
- zLevel for drawing
-
addTexturedQuad
public static void addTexturedQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset) Adds a textured quad to the buffer builder. The vertex format must beDefaultVertexFormat.POSITION_TEX
and the draw format must beVertexFormat.Mode.QUADS
- Parameters:
bufferBuilder
- Buffer builderposeStack
- Pose stackx1
- X1 coordinatex2
- X2 coordinatey1
- Y1 coordinatey2
- Y2 coordinateu1
- U1 coordinateu2
- U2 coordinatev1
- V1 coordinatev2
- V2 coordinateblitOffset
- zLevel for drawing
-
addColoredQuad
public static void addColoredQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, RGBA color, float blitOffset) Adds a quad to the buffer builder. The vertex format must beDefaultVertexFormat.POSITION_COLOR
and the draw format must beVertexFormat.Mode.QUADS
- Parameters:
bufferBuilder
- Buffer builderposeStack
- Pose stackx1
- X1 coordinatex2
- X2 coordinatey1
- Y1 coordinatey2
- Y2 coordinatecolor
- Color of the verticesblitOffset
- zLevel for drawing
-
addQuad
public static void addQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float blitOffset) Adds a quad to the buffer builder. The vertex format must beDefaultVertexFormat.POSITION
and the draw format must beVertexFormat.Mode.QUADS
- Parameters:
bufferBuilder
- Buffer builderposeStack
- Pose stackx1
- X1 coordinatex2
- X2 coordinatey1
- Y1 coordinatey2
- Y2 coordinateblitOffset
- zLevel for drawing
-
setShaderColor
Sets the shader color fromRGBA
type- Parameters:
rgba
- Color
-