Class Font.PreparedTextBuilder

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

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

    • drawShadow

      private final boolean drawShadow
    • color

      private final int color
    • backgroundColor

      private final int backgroundColor
    • includeEmpty

      private final boolean includeEmpty
    • x

      float x
    • y

      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

      final List<TextRenderable.Styled> glyphs
    • effects

      private @Nullable List<TextRenderable> effects
    • emptyAreas

      private @Nullable List<EmptyArea> emptyAreas
  • Constructor Details

    • PreparedTextBuilder

      public PreparedTextBuilder(float pX, float pY, int pColor, boolean pDrawShadow, boolean pIncludeEmpty)
    • PreparedTextBuilder

      public PreparedTextBuilder(float pX, float pY, int pColor, int pBackgroundColor, boolean pDrawShadow, boolean pIncludeEmpty)
  • Method Details

    • markSize

      private void markSize(float pLeft, float pTop, float pRight, float pBottom)
    • markBackground

      private void markBackground(float pX, float pY, float pAdvance)
    • addGlyph

      private void addGlyph(TextRenderable.Styled pGlyph)
    • addEffect

      private void addEffect(TextRenderable pEffect)
    • addEmptyGlyph

      private void addEmptyGlyph(EmptyArea pEmptyArea)
    • accept

      public boolean accept(int p_425893_, Style p_426323_, int p_426324_)
      Description copied from interface: FormattedCharSink
      Accepts a single code point from a FormattedCharSequence.
      Specified by:
      accept in interface FormattedCharSink
      Parameters:
      p_425893_ - 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 pPositionInCurrentSequence, Style pStyle, BakedGlyph pGlyph)
    • visit

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

      private int getTextColor(@Nullable TextColor pTextColor)
    • getShadowColor

      private int getShadowColor(Style pStyle, int pTextColor)
    • bounds

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