Class FontType

java.lang.Object
engine.fontMeshCreator.FontType

public class FontType extends Object
Represents a font. It holds the font's texture atlas as well as having the ability to create the quad vertices for any text using this font.
  • Constructor Details

    • FontType

      public FontType(int textureAtlas, File fontFile)
      Creates a new font and loads up the data about each character from the font file.
      Parameters:
      textureAtlas - - the ID of the font atlas texture.
      fontFile - - the font file containing information about each character in the texture atlas.
  • Method Details

    • getTextureAtlas

      public int getTextureAtlas()
      Returns:
      The font texture atlas.
    • loadText

      public TextMeshData loadText(GUIText text)
      Takes in an unloaded text and calculate all of the vertices for the quads on which this text will be rendered. The vertex positions and texture coords and calculated based on the information from the font file.
      Parameters:
      text - - the unloaded text.
      Returns:
      Information about the vertices of all the quads.