Class Font.PreparedTextBuilder

java.lang.Object
net.minecraft.client.gui.Font.PreparedTextBuilder
All Implemented Interfaces:
Font.PreparedText, FormattedCharSink
Enclosing class:
Font

private class Font.PreparedTextBuilder extends Object implements Font.PreparedText, FormattedCharSink
  • Field Details

    • drawShadow

      private final boolean drawShadow
    • color

      private final int color
    • backgroundColor

      private final int backgroundColor
    • includeEmpty

      private final boolean includeEmpty
    • x

      private float x
    • y

      private float y
    • left

      private float left
    • top

      private float top
    • bottom

      private float bottom
    • backgroundLeft

      private float backgroundLeft
    • backgroundTop

      private float backgroundTop
    • backgroundRight

      private float backgroundRight
    • backgroundBottom

      private float backgroundBottom
    • glyphs

      private final List<TextRenderable.Styled> glyphs
    • effects

      private @Nullable List<TextRenderable> effects
    • emptyAreas

      private @Nullable List<EmptyArea> emptyAreas
  • Constructor Details

    • PreparedTextBuilder

      public PreparedTextBuilder(float x, float y, int color, boolean drawShadow, boolean includeEmpty)
    • PreparedTextBuilder

      public PreparedTextBuilder(float x, float y, int color, int backgroundColor, boolean drawShadow, boolean includeEmpty)
  • Method Details

    • markSize

      private void markSize(float left, float top, float right, float bottom)
    • markBackground

      private void markBackground(float x, float y, float advance)
    • addGlyph

      private void addGlyph(TextRenderable.Styled instance)
    • addEffect

      private void addEffect(TextRenderable effect)
    • addEmptyGlyph

      private void addEmptyGlyph(EmptyArea empty)
    • accept

      public boolean accept(int position, Style style, int c)
      Description copied from interface: FormattedCharSink
      Accepts a single code point from a FormattedCharSequence.
      Specified by:
      accept in interface FormattedCharSink
      Parameters:
      position - Contains the relative position of the character in the current sub-sequence. If multiple formatted char sequences have been combined, this value will reset to 0 after each sequence has been fully consumed.
      Returns:
      true to accept more characters, false to stop traversing the sequence.
    • accept

      public boolean accept(int position, Style style, BakedGlyph glyph)
    • visit

      public void visit(Font.GlyphVisitor visitor)
      Specified by:
      visit in interface Font.PreparedText
    • getTextColor

      private int getTextColor(@Nullable TextColor textColor)
    • getShadowColor

      private int getShadowColor(Style style, int textColor)
    • bounds

      public @Nullable ScreenRectangle bounds()
      Specified by:
      bounds in interface Font.PreparedText