org.newdawn.slick
Interface Font

All Known Implementing Classes:
AngelCodeFont, SpriteSheetFont, TrueTypeFont, UnicodeFont

public interface Font

The proprites of any font implementation

Author:
Kevin Glass

Method Summary
 void drawString(float x, float y, java.lang.String text)
          Draw a string to the screen
 void drawString(float x, float y, java.lang.String text, Color col)
          Draw a string to the screen
 void drawString(float x, float y, java.lang.String text, Color col, int startIndex, int endIndex)
          Draw part of a string to the screen.
 int getHeight(java.lang.String str)
          Get the height of the given string
 int getLineHeight()
          Get the maximum height of any line drawn by this font
 int getWidth(java.lang.String str)
          Get the width of the given string
 

Method Detail

getWidth

int getWidth(java.lang.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

getHeight

int getHeight(java.lang.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

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

drawString

void drawString(float x,
                float y,
                java.lang.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,
                java.lang.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,
                java.lang.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


Copyright © 2006 New Dawn Software. All Rights Reserved.