|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.TrueTypeFont
public class TrueTypeFont
A TrueType font implementation for Slick
Constructor Summary | |
---|---|
TrueTypeFont(java.awt.Font font,
boolean antiAlias)
Constructor for the TrueTypeFont class Pass in the preloaded standard Java TrueType font, and whether you want it to be cached with AntiAliasing applied. |
|
TrueTypeFont(java.awt.Font font,
boolean antiAlias,
char[] additionalChars)
Constructor for the TrueTypeFont class Pass in the preloaded standard Java TrueType font, and whether you want it to be cached with AntiAliasing applied. |
Method Summary | |
---|---|
void |
drawString(float x,
float y,
java.lang.String whatchars)
Draw a string |
void |
drawString(float x,
float y,
java.lang.String whatchars,
Color color)
Draw a string |
void |
drawString(float x,
float y,
java.lang.String whatchars,
Color color,
int startIndex,
int endIndex)
Draw part of a string to the screen. |
int |
getHeight()
Get the font's height |
int |
getHeight(java.lang.String HeightString)
Get the height of a String |
int |
getLineHeight()
Get the font's line height |
int |
getWidth(java.lang.String whatchars)
Get the width of a given String |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrueTypeFont(java.awt.Font font, boolean antiAlias, char[] additionalChars)
font
- Standard Java AWT fontantiAlias
- Whether or not to apply AntiAliasing to the cached fontadditionalChars
- Characters of font that will be used in addition of first 256 (by unicode).public TrueTypeFont(java.awt.Font font, boolean antiAlias)
font
- Standard Java AWT fontantiAlias
- Whether or not to apply AntiAliasing to the cached fontMethod Detail |
---|
public int getWidth(java.lang.String whatchars)
getWidth
in interface Font
whatchars
- The characters to get the width of
public int getHeight()
public int getHeight(java.lang.String HeightString)
getHeight
in interface Font
HeightString
- The string to obtain the rendered with of
public int getLineHeight()
getLineHeight
in interface Font
public void drawString(float x, float y, java.lang.String whatchars, Color color)
drawString
in interface Font
x
- The x position to draw the stringy
- The y position to draw the stringwhatchars
- The string to drawcolor
- The color to draw the textpublic void drawString(float x, float y, java.lang.String whatchars, Color color, int startIndex, int endIndex)
Font
drawString
in interface Font
x
- The x location at which to draw the stringy
- The y location at which to draw the stringwhatchars
- The text to be displayedcolor
- The colour to draw withstartIndex
- The index of the first character to drawendIndex
- The index of the last character from the string to drawFont.drawString(float, float, String, org.newdawn.slick.Color, int, int)
public void drawString(float x, float y, java.lang.String whatchars)
drawString
in interface Font
x
- The x position to draw the stringy
- The y position to draw the stringwhatchars
- The string to draw
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |