public class BitmapFontImpl extends Object implements BitmapFont
| Constructor and Description |
|---|
BitmapFontImpl(BitmapFontRenderer fontRenderer,
ResourceLoader resourceLoader,
BitmapFontData fontData,
String filename)
Create a BitmapFont using the given BitmapFontRenderer and the BitmapFontData.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCharacterWidth(char currentCharacter,
char nextCharacter)
Get the width of a single character.
|
int |
getCharacterWidth(char currentCharacter,
char nextCharacter,
float size)
The same as the getCharacterWidth(int, char) method but takes a scaled size into account.
|
int |
getHeight()
The height of the given font (the lineHeight property of the font data)
|
int |
getStringWidth(String text)
Returns the width of the given String.
|
int |
getStringWidth(String text,
float size)
The same as the getStringWidthInternal(String) method that takes the given size into account.
|
void |
renderText(int x,
int y,
String text)
Output text at the given x and y positon.
|
void |
renderText(int x,
int y,
String text,
float sizeX,
float sizeY,
float r,
float g,
float b,
float a)
Output text at the given x and y position using the given color and the r,g,b,a components.
|
public BitmapFontImpl(BitmapFontRenderer fontRenderer, ResourceLoader resourceLoader, BitmapFontData fontData, String filename)
fontRenderer - font rendererfontData - font datafilename - the original filename of the fnt (the path part is used to resolve any bitmap references inside
the .fnt file!)public void renderText(int x,
int y,
String text)
BitmapFontrenderText in interface BitmapFontx - x positiony - y positiontext - text to outputpublic void renderText(int x,
int y,
String text,
float sizeX,
float sizeY,
float r,
float g,
float b,
float a)
BitmapFontrenderText in interface BitmapFontx - x positiony - y positiontext - the text to outputsizeX - x scale factor of the text (this should be apply with x,y as the origin)sizeY - y scale factor of the text (this should be apply with x,y as the origin)r - redg - greenb - bluea - alphapublic int getCharacterWidth(char currentCharacter,
char nextCharacter)
BitmapFontgetCharacterWidth in interface BitmapFontcurrentCharacter - current characternextCharacter - next characterpublic int getCharacterWidth(char currentCharacter,
char nextCharacter,
float size)
BitmapFontgetCharacterWidth in interface BitmapFontpublic int getStringWidth(String text)
BitmapFontgetStringWidth in interface BitmapFonttext - the textpublic int getStringWidth(String text, float size)
BitmapFontgetStringWidth in interface BitmapFontpublic int getHeight()
BitmapFontgetHeight in interface BitmapFontCopyright © 2013. All Rights Reserved.