|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectzombie.core.fonts.AngelCodeFont
public class AngelCodeFont
A font implementation that will parse BMFont format font files. The font files can be output by Hiero, which is included with Slick, and also the AngelCode font tool available at: http://www.angelcode.com/products/bmfont/ This implementation copes with both the font display and kerning information allowing nicer looking paragraphs of text. Note that this utility only supports the text BMFont format definition file.
Field Summary | |
---|---|
static float |
curA
|
static float |
curB
|
static Color |
curCol
|
static float |
curG
|
static float |
curR
|
int |
xoff
|
int |
yoff
|
Constructor Summary | |
---|---|
AngelCodeFont(java.lang.String fntFile,
java.lang.String imgFile)
Create a new font based on a font definition from AngelCode's tool and the font image generated from the tool. |
|
AngelCodeFont(java.lang.String fntFile,
Texture image)
Create a new font based on a font definition from AngelCode's tool and the font image generated from the tool. |
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. |
void |
drawString(float x,
float y,
java.lang.String text,
float r,
float g,
float b,
float a)
|
void |
drawString(float x,
float y,
java.lang.String text,
float r,
float g,
float b,
float a,
int startIndex,
int endIndex)
|
int |
getHeight(java.lang.String text)
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 text)
get the width of the given string |
int |
getYOffset(java.lang.String text)
Returns the distance from the y drawing location to the top most pixel of the specified text. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int xoff
Font.drawString(float, float, String, Color, int, int)
public int yoff
public static Color curCol
public static float curR
public static float curG
public static float curB
public static float curA
Constructor Detail |
---|
public AngelCodeFont(java.lang.String fntFile, Texture image) throws java.io.FileNotFoundException
fntFile
- The location of the font defnition fileimage
- The image to use for the font
java.io.FileNotFoundException
SlickException
- Indicates a failure to load either filepublic AngelCodeFont(java.lang.String fntFile, java.lang.String imgFile) throws java.io.FileNotFoundException
fntFile
- The location of the font defnition fileimgFile
- The location of the font image
SlickException
- Indicates a failure to load either file
java.io.FileNotFoundException
Method Detail |
---|
public void drawString(float x, float y, java.lang.String text)
Font
drawString
in interface Font
x
- The x location at which to draw the stringy
- The y location at which to draw the stringtext
- The text to be displayedorg.newdawn.slick.Font#drawString(float, float, java.lang.String)
public void drawString(float x, float y, java.lang.String text, Color col)
Font
drawString
in interface Font
x
- The x location at which to draw the stringy
- The y location at which to draw the stringtext
- The text to be displayedcol
- The colour to draw withorg.newdawn.slick.Font#drawString(float, float, java.lang.String,
org.newdawn.slick.Color)
public void drawString(float x, float y, java.lang.String text, float r, float g, float b, float a)
public void drawString(float x, float y, java.lang.String text, Color col, 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 stringtext
- The text to be displayedcol
- The colour to draw withstartIndex
- The index of the first character to drawendIndex
- The index of the last character from the string to drawpublic void drawString(float x, float y, java.lang.String text, float r, float g, float b, float a, int startIndex, int endIndex)
public int getHeight(java.lang.String text)
Font
getHeight
in interface Font
text
- The string to obtain the rendered with of
org.newdawn.slick.Font#getHeight(java.lang.String)
public int getLineHeight()
Font
getLineHeight
in interface Font
org.newdawn.slick.Font#getLineHeight()
public int getWidth(java.lang.String text)
Font
getWidth
in interface Font
text
- The string to obtain the rendered with of
org.newdawn.slick.Font#getWidth(java.lang.String)
public int getYOffset(java.lang.String text)
text
- The text that is to be tested
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |