Modifier and Type | Field and Description |
---|---|
com.badlogic.gdx.graphics.g2d.BitmapFont |
bitmapFont |
Constructor and Description |
---|
LibgdxBitmapFont() |
LibgdxBitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData data,
org.mini2Dx.gdx.utils.Array<TextureRegion> pageRegions,
boolean integer) |
LibgdxBitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData data,
TextureRegion region,
boolean integer) |
LibgdxBitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont) |
LibgdxBitmapFont(FileHandle fileHandle) |
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
|
public LibgdxBitmapFont()
public LibgdxBitmapFont(FileHandle fileHandle)
public LibgdxBitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData data, TextureRegion region, boolean integer)
public LibgdxBitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData data, org.mini2Dx.gdx.utils.Array<TextureRegion> pageRegions, boolean integer)
public LibgdxBitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont)
public boolean loadInternal()
GameFont
GameFont
using Files.internal(String)
loadInternal
in interface GameFont
public boolean loadExternal()
GameFont
GameFont
using Files.external(String)
loadExternal
in interface GameFont
public boolean load(AssetManager assetManager)
GameFont
GameFont
via the AssetManager
load
in interface GameFont
assetManager
- The AssetManager
to usepublic void draw(Graphics g, java.lang.String str, float x, float y)
GameFont
Graphics
context using this fontpublic void draw(Graphics g, java.lang.String str, float x, float y, float targetWidth)
GameFont
Graphics
context using this fontpublic void draw(Graphics g, java.lang.String str, float x, float y, float targetWidth, int horizontalAlignment, boolean wrap)
GameFont
Graphics
context using this fontdraw
in interface GameFont
g
- 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 clippublic FontGlyphLayout newGlyphLayout()
GameFont
FontGlyphLayout
for this fontnewGlyphLayout
in interface GameFont
FontGlyphLayout
instancepublic FontGlyphLayout getSharedGlyphLayout()
GameFont
FontGlyphLayout
instance associated with this GameFont
instancegetSharedGlyphLayout
in interface GameFont
FontGlyphLayout
instance attached to this fontpublic GameFontCache newCache()
GameFont
GameFontCache
for this fontnewCache
in interface GameFont
GameFontCache
instancepublic Color getColor()
GameFont
Color
the font will be rendered withpublic void setColor(Color color)
GameFont
Color
to render the font withpublic float getLineHeight()
GameFont
getLineHeight
in interface GameFont
public float getCapHeight()
GameFont
getCapHeight
in interface GameFont
public boolean useIntegerPositions()
GameFont
useIntegerPositions
in interface GameFont