public interface GameFont
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of this font instance and its resources
|
void |
draw(Graphics g,
java.lang.String str,
float x,
float y)
Draws text to the
Graphics context using this font |
void |
draw(Graphics g,
java.lang.String str,
float x,
float y,
float targetWidth)
Draws text to the
Graphics context using this font |
void |
draw(Graphics g,
java.lang.String str,
float x,
float y,
float targetWidth,
int horizontalAlignment,
boolean wrap)
Draws text to the
Graphics context using this font |
float |
getCapHeight()
Returns the height of a capital letter above the baseline
|
Color |
getColor()
Returns the
Color the font will be rendered with |
float |
getLineHeight()
Returns the line height of the font
|
FontGlyphLayout |
getSharedGlyphLayout()
Returns a
FontGlyphLayout instance associated with this GameFont instance |
boolean |
load(AssetManager assetManager)
Loads the
GameFont via the AssetManager |
boolean |
loadExternal()
Loads the
GameFont using Files.external(String) |
boolean |
loadInternal()
Loads the
GameFont using Files.internal(String) |
GameFontCache |
newCache()
Creates a
GameFontCache for this font |
FontGlyphLayout |
newGlyphLayout()
Creates a
FontGlyphLayout for this font |
void |
setColor(Color color)
Sets the
Color to render the font with |
boolean |
useIntegerPositions()
Returns if characters use integer positions
|
boolean loadInternal()
GameFont
using Files.internal(String)
boolean loadExternal()
GameFont
using Files.external(String)
boolean load(AssetManager assetManager)
GameFont
via the AssetManager
assetManager
- The AssetManager
to usevoid draw(Graphics g, java.lang.String str, float x, float y)
Graphics
context using this fontg
- The Graphics
contextstr
- The text to renderx
- The x coordinate to draw aty
- The y coordinate to draw atvoid draw(Graphics g, java.lang.String str, float x, float y, float targetWidth)
Graphics
context using this fontg
- The Graphics
contextstr
- The text to renderx
- The x coordinate to draw aty
- The y coordinate to draw attargetWidth
- The target width to render with (Note: text will wrap if exceeding this width)void draw(Graphics g, java.lang.String str, float x, float y, float targetWidth, int horizontalAlignment, boolean wrap)
Graphics
context using this fontg
- The Graphics
contextstr
- The text to renderx
- The x coordinate to draw aty
- The y coordinate to draw attargetWidth
- The target width to render withhorizontalAlignment
- The horizontal alignment within the targetWidth. See Align
wrap
- True if text should wrap if exceeding targetWidth, false if it should clipFontGlyphLayout newGlyphLayout()
FontGlyphLayout
for this fontFontGlyphLayout
instanceFontGlyphLayout getSharedGlyphLayout()
FontGlyphLayout
instance associated with this GameFont
instanceFontGlyphLayout
instance attached to this fontGameFontCache newCache()
GameFontCache
for this fontGameFontCache
instanceColor getColor()
Color
the font will be rendered withfloat getLineHeight()
float getCapHeight()
boolean useIntegerPositions()
void dispose()