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 Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate final intprivate floatprivate floatprivate floatprivate floatprivate final intprivate final booleanprivate @Nullable List<TextRenderable> private final List<TextRenderable.Styled> private final booleanprivate floatprivate floatprivate floatprivate floatprivate float -
Constructor Summary
ConstructorsConstructorDescriptionPreparedTextBuilder(float x, float y, int color, boolean drawShadow, boolean includeEmpty) PreparedTextBuilder(float x, float y, int color, int backgroundColor, boolean drawShadow, boolean includeEmpty) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAccepts a single code point from aFormattedCharSequence.booleanaccept(int position, Style style, BakedGlyph glyph) private voidaddEffect(TextRenderable effect) private voidaddEmptyGlyph(EmptyArea empty) private voidaddGlyph(TextRenderable.Styled instance) @Nullable ScreenRectanglebounds()private intgetShadowColor(Style style, int textColor) private intgetTextColor(@Nullable TextColor textColor) private voidmarkBackground(float x, float y, float advance) private voidmarkSize(float left, float top, float right, float bottom) voidvisit(Font.GlyphVisitor visitor)
-
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 -
right
private float right -
bottom
private float bottom -
backgroundLeft
private float backgroundLeft -
backgroundTop
private float backgroundTop -
backgroundRight
private float backgroundRight -
backgroundBottom
private float backgroundBottom -
glyphs
-
effects
-
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
-
addEffect
-
addEmptyGlyph
-
accept
Description copied from interface:FormattedCharSinkAccepts a single code point from aFormattedCharSequence.- Specified by:
acceptin interfaceFormattedCharSink- 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 to0after each sequence has been fully consumed.- Returns:
trueto accept more characters,falseto stop traversing the sequence.
-
accept
-
visit
- Specified by:
visitin interfaceFont.PreparedText
-
getTextColor
-
getShadowColor
-
bounds
- Specified by:
boundsin interfaceFont.PreparedText
-