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
    • 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

    • effects

      @Nullable private List<BakedGlyph.Effect> effects
  • Constructor Details

    • PreparedTextBuilder

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

      public PreparedTextBuilder(float x, float y, int color, int backgroundColor, boolean dropShadow)
  • 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(BakedGlyph.GlyphInstance glyph)
    • addEffect

      private void addEffect(BakedGlyph.Effect effect)
    • accept

      public boolean accept(int positionInCurrentSequence, Style style, int codePoint)
      Accepts a single code point from a FormattedCharSequence.
      Specified by:
      accept in interface FormattedCharSink
      Parameters:
      positionInCurrentSequence - 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.
    • 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

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