Package net.minecraft.client.font
Class TextRenderer
java.lang.Object
net.minecraft.client.font.TextRenderer
@Environment(CLIENT) public class TextRenderer extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classTextRenderer.ShadowDrawer -
Field Summary
Fields Modifier and Type Field Description intfontHeightprivate Function<Identifier,FontStorage>fontStorageAccessorprivate static Vector3fFORWARD_SHIFTprivate TextHandlerhandlerRandomrandom -
Constructor Summary
Constructors Constructor Description TextRenderer(Function<Identifier,FontStorage> fontStorageAccessor) -
Method Summary
Modifier and Type Method Description intdraw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)intdraw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light, boolean rightToLeft)private intdraw(String text, float x, float y, int color, Matrix4f matrix, boolean shadow, boolean mirror)intdraw(MatrixStack matrices, String text, float x, float y, int color)intdraw(MatrixStack matrices, StringRenderable text, float x, float y, int color)intdraw(StringRenderable text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)private intdraw(StringRenderable text, float x, float y, int color, Matrix4f matrix, boolean shadow)private voiddrawGlyph(GlyphRenderer glyphRenderer, boolean bold, boolean italic, float weight, float x, float y, Matrix4f matrix, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int light)private intdrawInternal(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light, boolean mirror)private intdrawInternal(StringRenderable text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int backgroundColor, int light)private floatdrawLayer(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int underlineColor, int light)private floatdrawLayer(StringRenderable text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int underlineColor, int light)voiddrawTrimmed(StringRenderable text, int x, int y, int maxWidth, int color)intdrawWithShadow(MatrixStack matrices, String text, float x, float y, int color)intdrawWithShadow(MatrixStack matrices, String text, float x, float y, int color, boolean rightToLeft)intdrawWithShadow(MatrixStack matrices, StringRenderable text, float x, float y, int color)private FontStoragegetFontStorage(Identifier id)intgetStringBoundedHeight(String text, int maxWidth)TextHandlergetTextHandler()intgetWidth(String text)intgetWidth(StringRenderable stringRenderable)booleanisRightToLeft()Stringmirror(String text)StringtrimToWidth(String text, int maxWidth)StringtrimToWidth(String text, int maxWidth, boolean backwards)StringRenderabletrimToWidth(StringRenderable text, int width)private static inttweakTransparency(int argb)List<StringRenderable>wrapLines(StringRenderable text, int width)
-
Field Details
-
FORWARD_SHIFT
-
fontHeight
public final int fontHeight- See Also:
- Constant Field Values
-
random
-
fontStorageAccessor
-
handler
-
-
Constructor Details
-
Method Details
-
getFontStorage
-
drawWithShadow
-
drawWithShadow
public int drawWithShadow(MatrixStack matrices, String text, float x, float y, int color, boolean rightToLeft) -
draw
-
drawWithShadow
public int drawWithShadow(MatrixStack matrices, StringRenderable text, float x, float y, int color) -
draw
-
mirror
-
draw
-
draw
private int draw(StringRenderable text, float x, float y, int color, Matrix4f matrix, boolean shadow) -
draw
public int draw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light) -
draw
public int draw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light, boolean rightToLeft) -
draw
public int draw(StringRenderable text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light) -
tweakTransparency
private static int tweakTransparency(int argb) -
drawInternal
private int drawInternal(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light, boolean mirror) -
drawInternal
private int drawInternal(StringRenderable text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int backgroundColor, int light) -
drawLayer
private float drawLayer(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int underlineColor, int light) -
drawLayer
private float drawLayer(StringRenderable text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int underlineColor, int light) -
drawGlyph
private void drawGlyph(GlyphRenderer glyphRenderer, boolean bold, boolean italic, float weight, float x, float y, Matrix4f matrix, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int light) -
getWidth
-
getWidth
-
trimToWidth
-
trimToWidth
-
trimToWidth
-
drawTrimmed
-
getStringBoundedHeight
-
wrapLines
-
isRightToLeft
public boolean isRightToLeft() -
getTextHandler
-