Class GuiCanvas
java.lang.Object
com.render.api.GuiCanvas
Lightweight wrapper around
GuiGraphicsExtractor for HUD and screen rendering.-
Method Summary
Modifier and TypeMethodDescriptionvoidcenteredText(String text, int centerX, int y, int argb) Deprecated.voidcenteredText(String text, int centerX, int y, RenderColor color) Draws centered literal text with a shadow.voidcenteredText(String text, int centerX, int y, RenderColor color, GuiFont guiFont) voidcenteredText(String text, int centerX, int y, RenderColor color, GuiFont guiFont, float textSizePixels) voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, int argb) Deprecated.voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, int argb, boolean shadow) Deprecated.voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color) Draws centered component text with a shadow.voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, boolean shadow) Draws centered component text.voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont) voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont, boolean shadow) voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont, float textSizePixels) voidcenteredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont, float textSizePixels, boolean shadow) net.minecraft.client.gui.Fontfont()Returns the font used for text drawing.intheight()Returns the current GUI height in pixels.static GuiCanvasof(net.minecraft.client.gui.GuiGraphicsExtractor graphics) Wraps a rawGuiGraphicsExtractorinstance in aGuiCanvas.net.minecraft.client.gui.GuiGraphicsExtractorraw()Returns the wrappedGuiGraphicsExtractorinstance.voidrect(int x1, int y1, int x2, int y2, int argb) Deprecated.voidrect(int x1, int y1, int x2, int y2, RenderColor color) Fills a rectangle in ARGB color space.voidrectOutline(int x1, int y1, int x2, int y2, int argb) Deprecated.voidrectOutline(int x1, int y1, int x2, int y2, RenderColor color) Draws a one-pixel outline around a rectangle.text(GuiRichText text, float x, float y, GuiTextConstraints constraints) Draws fully styled rich text through the browser-grade renderer.text(String text, float x, float y, GuiTextStyle style, GuiTextConstraints constraints) voidDeprecated.voidtext(String text, int x, int y, RenderColor color) Draws literal text with a shadow.voidtext(String text, int x, int y, RenderColor color, GuiFont guiFont) voidtext(String text, int x, int y, RenderColor color, GuiFont guiFont, float textSizePixels) voidtext(net.minecraft.network.chat.Component text, int x, int y, int argb) Deprecated.voidtext(net.minecraft.network.chat.Component text, int x, int y, int argb, boolean shadow) Deprecated.voidtext(net.minecraft.network.chat.Component text, int x, int y, RenderColor color) Draws a component with a shadow.voidtext(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, boolean shadow) Draws a component at the supplied position.voidtext(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont) voidtext(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont, boolean shadow) voidtext(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont, float textSizePixels) voidtext(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont, float textSizePixels, boolean shadow) intintintintintwidth()Returns the current GUI width in pixels.
-
Method Details
-
of
-
raw
public net.minecraft.client.gui.GuiGraphicsExtractor raw()Returns the wrappedGuiGraphicsExtractorinstance.- Returns:
- the underlying graphics object
-
font
public net.minecraft.client.gui.Font font()Returns the font used for text drawing.- Returns:
- the active Minecraft font
-
width
public int width()Returns the current GUI width in pixels.- Returns:
- GUI width in pixels
-
height
public int height()Returns the current GUI height in pixels.- Returns:
- GUI height in pixels
-
rect
Fills a rectangle in ARGB color space.- Parameters:
x1- left edgey1- top edgex2- right edgey2- bottom edgecolor- fill color
-
rect
Deprecated. -
rectOutline
Draws a one-pixel outline around a rectangle.- Parameters:
x1- left edgey1- top edgex2- right edgey2- bottom edgecolor- outline color
-
rectOutline
Deprecated. -
text
Draws literal text with a shadow.- Parameters:
text- literal text to drawx- left positiony- top positioncolor- text color
-
text
Deprecated. -
text
Draws a component with a shadow.- Parameters:
text- text component to drawx- left positiony- top positioncolor- text color
-
text
@Deprecated(forRemoval=false) public void text(net.minecraft.network.chat.Component text, int x, int y, int argb) Deprecated. -
text
public void text(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, boolean shadow) Draws a component at the supplied position.- Parameters:
text- text component to drawx- left positiony- top positioncolor- text colorshadow- whether to draw the standard text shadow
-
text
@Deprecated(forRemoval=false) public void text(net.minecraft.network.chat.Component text, int x, int y, int argb, boolean shadow) Deprecated. -
text
-
text
public void text(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont) -
text
public void text(String text, int x, int y, RenderColor color, GuiFont guiFont, float textSizePixels) -
text
public void text(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont, float textSizePixels) -
text
public void text(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont, boolean shadow) -
text
public void text(net.minecraft.network.chat.Component text, int x, int y, RenderColor color, GuiFont guiFont, float textSizePixels, boolean shadow) -
centeredText
Draws centered literal text with a shadow.- Parameters:
text- literal text to drawcenterX- horizontal centery- top positioncolor- text color
-
centeredText
Deprecated. -
centeredText
public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color) Draws centered component text with a shadow.- Parameters:
text- text component to drawcenterX- horizontal centery- top positioncolor- text color
-
centeredText
@Deprecated(forRemoval=false) public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, int argb) Deprecated. -
centeredText
public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, boolean shadow) Draws centered component text.- Parameters:
text- text component to drawcenterX- horizontal centery- top positioncolor- text colorshadow- whether to draw the standard text shadow
-
centeredText
@Deprecated(forRemoval=false) public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, int argb, boolean shadow) Deprecated. -
centeredText
-
centeredText
public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont) -
centeredText
public void centeredText(String text, int centerX, int y, RenderColor color, GuiFont guiFont, float textSizePixels) -
centeredText
public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont, float textSizePixels) -
centeredText
public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont, boolean shadow) -
centeredText
public void centeredText(net.minecraft.network.chat.Component text, int centerX, int y, RenderColor color, GuiFont guiFont, float textSizePixels, boolean shadow) -
textWidth
-
textWidth
-
textWidth
-
textWidth
public int textWidth(net.minecraft.network.chat.Component text, GuiFont guiFont, float textSizePixels) -
text
Draws fully styled rich text through the browser-grade renderer. -
text
public GuiTextLayout text(String text, float x, float y, GuiTextStyle style, GuiTextConstraints constraints)
-
centeredText(String, int, int, RenderColor).