@Environment(value=CLIENT)
public interface FontRendererAPI
Keep in mind that the list of printable characters is very small for this font renderer, due to the small number of characters in the font sheet.
| Modifier and Type | Interface and Description |
|---|---|
static class |
FontRendererAPI.Font
Font type; small font is found on eg.
|
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.client.render.VertexConsumer |
chooseVertexConsumer(FontRendererAPI.Font font,
net.minecraft.client.render.VertexConsumerProvider vcp)
Query an appropriate
VertexConsumer for a given font type. |
void |
drawString(FontRendererAPI.Font font,
net.minecraft.client.util.math.MatrixStack.Entry matrices,
net.minecraft.client.render.VertexConsumer vc,
int light,
int overlay,
int color,
java.lang.CharSequence string,
int maxChars)
Render up to the specified amount of characters of the specified string.
|
void |
drawString(java.lang.String string)
Render the specified string.
|
void |
drawString(java.lang.String string,
int maxChars)
Render up to the specified amount of characters of the specified string.
|
int |
getCharHeight()
Get the height of the characters drawn with the font renderer, in pixels.
|
int |
getCharWidth()
Get the width of the characters drawn with the font renderer, in pixels.
|
void drawString(java.lang.String string)
string - the string to render.void drawString(java.lang.String string,
int maxChars)
This is intended as a convenience method for clamped-width rendering, avoiding additional string operations such as substring.
string - the string to render.maxChars - the maximum number of characters to render.void drawString(FontRendererAPI.Font font, net.minecraft.client.util.math.MatrixStack.Entry matrices, net.minecraft.client.render.VertexConsumer vc, int light, int overlay, int color, java.lang.CharSequence string, int maxChars)
font - the font type.matrices - the current transformation.vc - the VertexConsumer queried via chooseVertexConsumer.light - the light value, usually RenderUtil.maxLight.overlay - the overlay value, passed from vanilla.color - the text color, in 0xAARRGGBB.string - the string to render.maxChars - the maximum number of characters to render.net.minecraft.client.render.VertexConsumer chooseVertexConsumer(FontRendererAPI.Font font, net.minecraft.client.render.VertexConsumerProvider vcp)
VertexConsumer for a given font type.font - the font type.vcp - the VertexConsumerProvider for this frame.int getCharWidth()
int getCharHeight()