Interface Font

All Known Implementing Classes:
AngelCodeFont

public interface Font
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawString(float x, float y, String text)
    Draw a string to the screen
    void
    drawString(float x, float y, String text, Color col)
    Draw a string to the screen
    void
    drawString(float x, float y, String text, Color col, int startIndex, int endIndex)
    Draw part of a string to the screen.
    int
    get the height of the given string
    int
    get the maximum height of any line drawn by this font
    int
    get the width of the given string
    int
    getWidth(String str, boolean xAdvance)
     
    int
    getWidth(String str, int startIndex, int endIndex)
     
    int
    getWidth(String str, int startIndex, int endIndex, boolean xAdvance)
     
  • Method Details

    • drawString

      void drawString(float x, float y, String text)
      Draw a string to the screen
      Parameters:
      x - The x location at which to draw the string
      y - The y location at which to draw the string
      text - The text to be displayed
    • drawString

      void drawString(float x, float y, String text, Color col)
      Draw a string to the screen
      Parameters:
      x - The x location at which to draw the string
      y - The y location at which to draw the string
      text - The text to be displayed
      col - The colour to draw with
    • drawString

      void drawString(float x, float y, String text, Color col, int startIndex, int endIndex)
      Draw part of a string to the screen. Note that this will still position the text as though it's part of the bigger string.
      Parameters:
      x - The x location at which to draw the string
      y - The y location at which to draw the string
      text - The text to be displayed
      col - The colour to draw with
      startIndex - The index of the first character to draw
      endIndex - The index of the last character from the string to draw
    • getHeight

      int getHeight(String str)
      get the height of the given string
      Parameters:
      str - The string to obtain the rendered with of
      Returns:
      The width of the given string
    • getWidth

      int getWidth(String str)
      get the width of the given string
      Parameters:
      str - The string to obtain the rendered with of
      Returns:
      The width of the given string
    • getWidth

      int getWidth(String str, boolean xAdvance)
    • getWidth

      int getWidth(String str, int startIndex, int endIndex)
    • getWidth

      int getWidth(String str, int startIndex, int endIndex, boolean xAdvance)
    • getLineHeight

      int getLineHeight()
      get the maximum height of any line drawn by this font
      Returns:
      The maxium height of any line drawn by this font