Class AngelCodeFont
java.lang.Object
zombie.core.fonts.AngelCodeFont
- All Implemented Interfaces:
- AssetStateObserver,- Font
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:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassThe definition of a single character as defined in the AngelCode file formatstatic final class
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionAngelCodeFont(String _fntFile, String imgFile) Create a new font based on a font definition from AngelCode's tool and the font image generated from the tool.AngelCodeFont(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 SummaryModifier and TypeMethodDescriptionvoiddestroy()voiddrawString(float x, float y, float scale, String text, float r, float g, float b, float a) voiddrawString(float x, float y, float scale, String text, float r, float g, float b, float a, int startIndex, int endIndex) voiddrawString(float x, float y, String text) Description copied from interface: FontvoiddrawString(float x, float y, String text, float r, float g, float b, float a) voiddrawString(float x, float y, String text, float r, float g, float b, float a, int startIndex, int endIndex) voiddrawString(float x, float y, String text, Color col) Description copied from interface: FontvoiddrawString(float x, float y, String text, Color col, int startIndex, int endIndex) Description copied from interface: FontintDescription copied from interface: FontintintDescription copied from interface: FontintDescription copied from interface: FontintintintintgetYOffset(String text) Returns the distance from the y drawing location to the top most pixel of the specified text.booleanisEmpty()booleanisSdf()voidonStateChanged(Asset.State oldState, Asset.State newState, Asset asset) voidsetSdf(boolean boolean0) 
- 
Field Details- 
charsThe characters building up the font
- 
xoffpublic static int xoff
- 
yoffpublic static int yoff
- 
curCol
- 
curRpublic static float curR
- 
curGpublic static float curG
- 
curBpublic static float curB
- 
curApublic static float curA
 
- 
- 
Constructor Details- 
AngelCodeFontCreate a new font based on a font definition from AngelCode's tool and the font image generated from the tool.- Parameters:
- _fntFile- The location of the font defnition file
- image- The image to use for the font
- Throws:
- FileNotFoundException
 
- 
AngelCodeFontCreate a new font based on a font definition from AngelCode's tool and the font image generated from the tool.- Parameters:
- _fntFile- The location of the font defnition file
- imgFile- The location of the font image
- Throws:
- FileNotFoundException
 
 
- 
- 
Method Details- 
drawStringDescription copied from interface: Font- Specified by:
- drawStringin interface- Font
- 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
 
- 
drawStringDescription copied from interface: Font- Specified by:
- drawStringin interface- Font
- 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
- 
drawStringpublic void drawString(float x, float y, float scale, String text, float r, float g, float b, float a) 
- 
drawStringDescription copied from interface: Font- Specified by:
- drawStringin interface- Font
- 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
 
- 
drawStringpublic void drawString(float x, float y, String text, float r, float g, float b, float a, int startIndex, int endIndex) 
- 
drawStringpublic void drawString(float x, float y, float scale, String text, float r, float g, float b, float a, int startIndex, int endIndex) 
- 
getHeight
- 
getHeight
- 
getLineHeightpublic int getLineHeight()Description copied from interface: Font- Specified by:
- getLineHeightin interface- Font
- Returns:
- The maxium height of any line drawn by this font
 
- 
getWidth
- 
getWidth
- 
getWidth
- 
getWidth
- 
getYOffsetReturns the distance from the y drawing location to the top most pixel of the specified text.- Parameters:
- text- The text that is to be tested
- Returns:
- The yoffset from the y draw location at which text will start
 
- 
onStateChanged- Specified by:
- onStateChangedin interface- AssetStateObserver
 
- 
isEmptypublic boolean isEmpty()
- 
isSdfpublic boolean isSdf()
- 
setSdfpublic void setSdf(boolean boolean0) 
- 
destroypublic void destroy()
 
-