Class TextRenderer

java.lang.Object
net.minecraft.client.font.TextRenderer

@Environment(CLIENT)
public class TextRenderer
extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getFontStorage

      private FontStorage getFontStorage​(Identifier id)
    • drawWithShadow

      public int drawWithShadow​(MatrixStack matrices, String text, float x, float y, int color)
      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

      public int draw​(MatrixStack matrices, String text, float x, float y, int color)
      Parameters:
      color - the text color in the 0xAARRGGBB format
    • drawWithShadow

      public int drawWithShadow​(MatrixStack matrices, OrderedText text, float x, float y, int color)
      Parameters:
      color - the text color in the 0xAARRGGBB format
    • drawWithShadow

      public int drawWithShadow​(MatrixStack matrices, Text text, float x, float y, int color)
      Parameters:
      color - the text color in the 0xAARRGGBB format
    • draw

      public int draw​(MatrixStack matrices, OrderedText text, float x, float y, int color)
      Parameters:
      color - the text color in the 0xAARRGGBB format
    • draw

      public int draw​(MatrixStack matrices, Text text, float x, float y, int color)
      Parameters:
      color - the text color in the 0xAARRGGBB format
    • mirror

      public String mirror​(String text)
    • draw

      private int draw​(String text, float x, float y, int color, Matrix4f matrix, boolean shadow, boolean mirror)
    • draw

      private int draw​(OrderedText 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)
      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

      public int getWidth​(String text)
    • getWidth

      public int getWidth​(StringVisitable text)
    • getWidth

      public int getWidth​(OrderedText text)
    • trimToWidth

      public String trimToWidth​(String text, int maxWidth, boolean backwards)
    • trimToWidth

      public String trimToWidth​(String text, int maxWidth)
    • trimToWidth

      public StringVisitable trimToWidth​(StringVisitable text, int width)
    • drawTrimmed

      public void drawTrimmed​(StringVisitable text, int x, int y, int maxWidth, int color)
      Parameters:
      color - the text color in the 0xAARRGGBB format
    • getStringBoundedHeight

      public int getStringBoundedHeight​(String text, int maxWidth)
    • wrapLines

      public List<OrderedText> wrapLines​(StringVisitable text, int width)
    • isRightToLeft

      public boolean isRightToLeft()
    • getTextHandler

      public TextHandler getTextHandler()