Interface Font<F extends Font<F>>

Type Parameters:
F - type of the class implementing this class
All Known Implementing Classes:
BitmapFont

public interface Font<F extends Font<F>>
Represents any font.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    getTextHeight​(String text, float height, float spacingVertical)
    Gets the height of a given text.
    float
    getTextWidth​(String text, float height, float spacingHorizontal)
    Gets the width of a given text.
    render​(String text, float x, float y, float height, float spacingHorizontal, float spacingVertical)
    Render a given text onto the current target frame buffer using texture coordinates.
  • Method Details

    • getTextWidth

      float getTextWidth(String text, float height, float spacingHorizontal)
      Gets the width of a given text.
      Parameters:
      text - text to calculate width of
      height - height of the text
      spacingHorizontal - spacing between characters on the x-axis
    • getTextHeight

      float getTextHeight(String text, float height, float spacingVertical)
      Gets the height of a given text.
      Parameters:
      text - text to calculate width of
      height - height of the text
      spacingVertical - spacing between characters on the y-axis
    • render

      F render(String text, float x, float y, float height, float spacingHorizontal, float spacingVertical) throws NotOnGraphicsThreadException
      Render a given text onto the current target frame buffer using texture coordinates.
      Parameters:
      text - text to render
      x - position of the bottom left corner of the rendered text on the x-axis
      y - position of the bottom left corner of the rendered text on the y-axis
      height - height of the text
      spacingHorizontal - space between every character on the x-axis
      spacingVertical - space between every character on the y-axis
      Throws:
      NotOnGraphicsThreadException