Package net.minecraft.client.gui
Class Font.PreparedTextBuilder
java.lang.Object
net.minecraft.client.gui.Font.PreparedTextBuilder
- All Implemented Interfaces:
Font.PreparedText
,FormattedCharSink
- Enclosing class:
Font
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
private final int
private float
private float
private float
private float
private final int
private final boolean
private List
<BakedGlyph.Effect> (package private) final List
<BakedGlyph.GlyphInstance> private float
private float
private float
(package private) float
(package private) float
-
Constructor Summary
ConstructorsConstructorDescriptionPreparedTextBuilder
(float pX, float pY, int pColor, boolean pDropShadow) PreparedTextBuilder
(float pX, float pY, int pColor, int pBackgroundColor, boolean pDropShadow) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Accepts a single code point from aFormattedCharSequence
.private void
addEffect
(BakedGlyph.Effect pEffect) private void
addGlyph
(BakedGlyph.GlyphInstance pGlyph) bounds()
private int
getShadowColor
(Style pStyle, int pTextColor) private int
getTextColor
(TextColor pTextColor) private void
markBackground
(float pX, float pY, float pAdvance) private void
markSize
(float pLeft, float pTop, float pRight, float pBottom) void
visit
(Font.GlyphVisitor pVisitor)
-
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 -
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
-
-
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
-
addEffect
-
accept
Accepts a single code point from aFormattedCharSequence
.- Specified by:
accept
in interfaceFormattedCharSink
- 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 to0
after each sequence has been fully consumed.- Returns:
true
to accept more characters,false
to stop traversing the sequence.
-
visit
- Specified by:
visit
in interfaceFont.PreparedText
-
getTextColor
-
getShadowColor
-
bounds
- Specified by:
bounds
in interfaceFont.PreparedText
-