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.Drawer -
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, OrderedText text, float x, float y, int color)intdraw(MatrixStack matrices, Text text, float x, float y, int color)intdraw(OrderedText text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)private intdraw(OrderedText text, float x, float y, int color, Matrix4f matrix, boolean shadow)intdraw(Text text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)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(OrderedText 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(OrderedText text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumerProvider, boolean seeThrough, int underlineColor, int light)voiddrawTrimmed(StringVisitable 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, OrderedText text, float x, float y, int color)intdrawWithShadow(MatrixStack matrices, Text text, float x, float y, int color)private FontStoragegetFontStorage(Identifier id)intgetStringBoundedHeight(String text, int maxWidth)TextHandlergetTextHandler()intgetWidth(String text)intgetWidth(OrderedText text)intgetWidth(StringVisitable text)booleanisRightToLeft()Stringmirror(String text)StringtrimToWidth(String text, int maxWidth)StringtrimToWidth(String text, int maxWidth, boolean backwards)StringVisitabletrimToWidth(StringVisitable text, int width)private static inttweakTransparency(int argb)List<OrderedText>wrapLines(StringVisitable text, int width)
-
Field Details
-
FORWARD_SHIFT
-
fontHeight
public final int fontHeight- See Also:
- Constant Field Values
-
random
-
fontStorageAccessor
-
handler
-
-
Constructor Details
-
TextRenderer
-
-
Method Details
-
getFontStorage
-
drawWithShadow
- Parameters:
color- the text color in the 0xAARRGGBB format
-
drawWithShadow
public int drawWithShadow(MatrixStack matrices, String text, float x, float y, int color, boolean rightToLeft)- Parameters:
color- the text color in the 0xAARRGGBB format
-
draw
- Parameters:
color- the text color in the 0xAARRGGBB format
-
drawWithShadow
- Parameters:
color- the text color in the 0xAARRGGBB format
-
drawWithShadow
- Parameters:
color- the text color in the 0xAARRGGBB format
-
draw
- Parameters:
color- the text color in the 0xAARRGGBB format
-
draw
- Parameters:
color- the text color in the 0xAARRGGBB format
-
mirror
-
draw
-
draw
-
draw
public int draw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)- Parameters:
color- the text color in the 0xAARRGGBB format
-
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)- Parameters:
color- the text color in the 0xAARRGGBB format
-
draw
public int draw(Text text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)- Parameters:
color- the text color in the 0xAARRGGBB format
-
draw
public int draw(OrderedText text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light)- Parameters:
color- the text color in the 0xAARRGGBB format
-
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(OrderedText 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(OrderedText 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
-
getWidth
-
trimToWidth
-
trimToWidth
-
trimToWidth
-
drawTrimmed
- Parameters:
color- the text color in the 0xAARRGGBB format
-
getStringBoundedHeight
-
wrapLines
-
isRightToLeft
public boolean isRightToLeft() -
getTextHandler
-