Class Line

java.lang.Object
engine.fontMeshCreator.Line

public class Line extends Object
Represents a line of text during the loading of a text.
  • 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

      protected boolean attemptToAddWord(Word word)
      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

      protected List<Word> getWords()
      Returns:
      The list of words in the line.