Package engine.fontMeshCreator
Class Line
java.lang.Object
engine.fontMeshCreator.Line
Represents a line of text during the loading of a text.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Line
(double spaceWidth, double fontSize, double maxLength) Creates an empty line. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
attemptToAddWord
(Word word) Attempt to add a word to the line.protected double
protected double
getWords()
-
Constructor Details
-
Line
protected Line(double spaceWidth, double fontSize, double maxLength) Creates an empty line.- Parameters:
spaceWidth
- - the screen-space width of a space character.fontSize
- - the size of font being used.maxLength
- - the screen-space maximum length of a line.
-
-
Method Details
-
attemptToAddWord
Attempt to add a word to the line. If the line can fit the word in without reaching the maximum line length then the word is added and the line length increased.- Parameters:
word
- - the word to try to add.- Returns:
true
if the word has successfully been added to the line.
-
getMaxLength
protected double getMaxLength()- Returns:
- The max length of the line.
-
getLineLength
protected double getLineLength()- Returns:
- The current screen-space length of the line.
-
getWords
- Returns:
- The list of words in the line.
-