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 pX, float pY, int pColor, boolean pDropShadow)
    • PreparedTextBuilder

      public PreparedTextBuilder(float pX, float pY, int pColor, int pBackgroundColor, boolean pDropShadow)
  • 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(BakedGlyph.GlyphInstance pGlyph)
    • addEffect

      private void addEffect(BakedGlyph.Effect pEffect)
    • accept

      public boolean accept(int pPositionInCurrentSequence, Style pStyle, int pCodePoint)
      Accepts a single code point from a FormattedCharSequence.
      Specified by:
      accept in interface FormattedCharSink
      Parameters:
      pPositionInCurrentSequence - 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 pVisitor)
      Specified by:
      visit in interface Font.PreparedText
    • getTextColor

      private int getTextColor(@Nullable TextColor pTextColor)
    • getShadowColor

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

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