Class RenderUtils
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.utils.RenderUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidblitInscribed(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight) static voidblitInscribed(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY) static voidblitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, NineSliceInfo.TextureInfo texture, int x, int y, int width, int height, NineSliceInfo.SliceBounds slices, NineSliceInfo.TextureRegion region) static voidblitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int sliceSize, int textureWidth, int textureHeight) static voidblitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int sliceWidth, int sliceHeight, int textureWidth, int textureHeight) static voidblitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int sliceLeft, int sliceTop, int sliceRight, int sliceBottom, int textureWidth, int textureHeight) static voidblitRepeating(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation atlas, int x, int y, int width, int height, int u, int v, int texW, int texH, int fullTexW, int fullTexH) Draws a texture section repeatedly to fill a rectangular area.static voidblitSprite(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height) Draws a whole texture stretched over the given area, with blending (the equivalent of newer versions'blitSpritefor a sprite without GUI scaling metadata).static voidblitSprite(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int color) blitSprite(GuiGraphics, ResourceLocation, int, int, int, int)tinted by an ARGB color.static voidblitWithBorder(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int border) static voidblitWithBorder(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder) static booleancontainsPoint(net.minecraft.client.gui.navigation.ScreenRectangle rectangle, double x, double y) Whether a point is inside a rectangle (right and bottom edges excluded).static net.minecraft.client.renderer.Rect2icreateRect2i(net.minecraft.client.gui.components.events.GuiEventListener listener) static voiddrawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int color) static voiddrawDebugGradient(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int width, int height) static voiddrawDiagonalGradient(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int width, int height, int color1, int color2) Render a diagonal gradient by interpolating color for each pixel.static voiddrawHollowRect(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int thickness, int color) static voiddrawHollowRect(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.navigation.ScreenRectangle rectangle, int thickness, int color) static voiddrawInsideRect(net.minecraft.client.gui.GuiGraphics guiGraphics, @NotNull net.minecraft.client.gui.navigation.ScreenRectangle rectangle, boolean shouldScissor, Runnable render) static voiddrawLine(net.minecraft.client.gui.GuiGraphics graphics, int x1, int y1, int x2, int y2, int color) static voiddrawScrollingString(net.minecraft.client.gui.GuiGraphics guiGraphics, int currentTick, net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component component, boolean center, net.minecraft.client.gui.navigation.ScreenRectangle bounds, int padding, int color, boolean shadow) static voiddrawScrollingString(net.minecraft.client.gui.GuiGraphics guiGraphics, int currentTick, net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component component, boolean center, net.minecraft.client.gui.navigation.ScreenRectangle bounds, net.minecraft.client.gui.navigation.ScreenRectangle scissor, int color, boolean shadow) static voiddrawScrollingString(net.minecraft.client.gui.GuiGraphics guiGraphics, int currentTick, net.minecraft.client.gui.Font font, net.minecraft.util.FormattedCharSequence sequence, boolean center, net.minecraft.client.gui.navigation.ScreenRectangle bounds, int padding, int color, boolean shadow) static voiddrawScrollingString(net.minecraft.client.gui.GuiGraphics guiGraphics, int currentTick, net.minecraft.client.gui.Font font, net.minecraft.util.FormattedCharSequence sequence, boolean center, net.minecraft.client.gui.navigation.ScreenRectangle bounds, net.minecraft.client.gui.navigation.ScreenRectangle scissor, int color, boolean shadow) static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int color) static voidfillHorizontalGradient(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int leftColor, int rightColor) static voidfillRect(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int color) static voidfillVerticalGradient(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int topColor, int bottomColor) static voidnextStratum(net.minecraft.client.gui.GuiGraphics graphics) Starts a new layer: everything drawn afterwards covers what was drawn before, whatever its depth.static inttextColor(int color) Makes a plain RGB color (no alpha bits) opaque, as the font renderer does.static voidMultiplies the color of everything drawn byrenderby an ARGB color.
-
Field Details
-
EMPTY_RECT2I
public static net.minecraft.client.renderer.Rect2i EMPTY_RECT2I
-
-
Constructor Details
-
RenderUtils
public RenderUtils()
-
-
Method Details
-
createRect2i
public static net.minecraft.client.renderer.Rect2i createRect2i(net.minecraft.client.gui.components.events.GuiEventListener listener) -
fillRect
public static void fillRect(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int color) -
drawHollowRect
public static void drawHollowRect(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int thickness, int color) -
drawLine
public static void drawLine(net.minecraft.client.gui.GuiGraphics graphics, int x1, int y1, int x2, int y2, int color) -
nextStratum
public static void nextStratum(net.minecraft.client.gui.GuiGraphics graphics) Starts a new layer: everything drawn afterwards covers what was drawn before, whatever its depth. Text (and items) in the GUI are drawn slightly in front of fills, so without this a fill drawn later at the same depth would not cover them. -
withTint
Multiplies the color of everything drawn byrenderby an ARGB color. -
fillVerticalGradient
public static void fillVerticalGradient(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int topColor, int bottomColor) -
fillHorizontalGradient
public static void fillHorizontalGradient(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, int leftColor, int rightColor) -
drawDiagonalGradient
public static void drawDiagonalGradient(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int width, int height, int color1, int color2) Render a diagonal gradient by interpolating color for each pixel. This is more expensive than a simple vertical/horizontal gradient. -
drawDebugGradient
public static void drawDebugGradient(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int width, int height) -
textColor
public static int textColor(int color) Makes a plain RGB color (no alpha bits) opaque, as the font renderer does. Kept so text colors behave the same on every Minecraft version the library supports (newer versions skip text with zero alpha). -
drawCenteredString
public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int color) -
drawString
public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int color) -
blitSprite
public static void blitSprite(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height) Draws a whole texture stretched over the given area, with blending (the equivalent of newer versions'blitSpritefor a sprite without GUI scaling metadata). -
blitSprite
public static void blitSprite(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int color) blitSprite(GuiGraphics, ResourceLocation, int, int, int, int)tinted by an ARGB color. -
blitNineSliced
public static void blitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int sliceSize, int textureWidth, int textureHeight) -
blitNineSliced
public static void blitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int sliceWidth, int sliceHeight, int textureWidth, int textureHeight) -
blitNineSliced
public static void blitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int sliceLeft, int sliceTop, int sliceRight, int sliceBottom, int textureWidth, int textureHeight) -
blitNineSliced
public static void blitNineSliced(net.minecraft.client.gui.GuiGraphics gfx, NineSliceInfo.TextureInfo texture, int x, int y, int width, int height, NineSliceInfo.SliceBounds slices, NineSliceInfo.TextureRegion region) -
blitRepeating
public static void blitRepeating(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation atlas, int x, int y, int width, int height, int u, int v, int texW, int texH, int fullTexW, int fullTexH) Draws a texture section repeatedly to fill a rectangular area. -
blitWithBorder
public static void blitWithBorder(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int border) -
blitWithBorder
public static void blitWithBorder(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder) -
blitInscribed
public static void blitInscribed(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY) -
blitInscribed
public static void blitInscribed(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
-