Package net.minecraft.client.font
Class TextHandler.WidthLimitingVisitor
java.lang.Object
net.minecraft.client.font.TextHandler.WidthLimitingVisitor
- All Implemented Interfaces:
CharacterVisitor
- Enclosing class:
- TextHandler
@Environment(CLIENT) class TextHandler.WidthLimitingVisitor extends Object implements CharacterVisitor
-
Field Summary
-
Constructor Summary
Constructors Constructor Description WidthLimitingVisitor(float maxWidth)
-
Method Summary
Modifier and Type Method Description boolean
accept(int index, Style style, int codePoint)
Visits a single character.int
getLength()
void
resetLength()
-
Field Details
-
widthLeft
private float widthLeft -
length
private int length
-
-
Constructor Details
-
WidthLimitingVisitor
public WidthLimitingVisitor(float maxWidth)
-
-
Method Details
-
accept
Visits a single character.Multiple surrogate characters are converted into one single
codePoint
when passed into this method.- Specified by:
accept
in interfaceCharacterVisitor
- Parameters:
index
- the current index of the characterstyle
- the style of the character, containing formatting and font informationcodePoint
- the code point of the character- Returns:
true
to continue visiting other characters, orfalse
to terminate the visit
-
getLength
public int getLength() -
resetLength
public void resetLength()
-