public class MonospaceFont extends java.lang.Object implements GameFont
BitmapFont except every character is a fixed-width which simplifies rendering calculations| Modifier and Type | Class and Description |
|---|---|
static class |
MonospaceFont.FontParameters |
static interface |
MonospaceFont.FontRenderListener |
| Constructor and Description |
|---|
MonospaceFont(MonospaceFont.FontParameters fontParameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes of this font instance and its resources
|
void |
draw(Graphics g,
com.badlogic.gdx.utils.Array<MonospaceGlyph> glyphs,
float x,
float y,
MonospaceFont.FontRenderListener listener) |
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 renderWidth)
Draws text to the
Graphics context using this font |
void |
draw(Graphics g,
java.lang.String str,
float x,
float y,
float renderWidth,
int horizontalAlignment,
boolean wrap)
Draws text to the
Graphics context using this font |
void |
draw(Graphics g,
java.lang.String str,
float x,
float y,
float renderWidth,
int horizontalAlignment,
boolean wrap,
MonospaceFont.FontRenderListener listener) |
void |
draw(Graphics g,
java.lang.String str,
float x,
float y,
float renderWidth,
MonospaceFont.FontRenderListener listener) |
float |
getCapHeight()
Returns the height of a capital letter above the baseline
|
com.badlogic.gdx.graphics.Color |
getColor()
Returns the
Color the font will be rendered with |
MonospaceFont.FontParameters |
getFontParameters() |
float |
getLineHeight()
Returns the line height of the font
|
FontGlyphLayout |
getSharedGlyphLayout()
Returns a
FontGlyphLayout instance associated with this GameFont instance |
TextureRegion |
getTextureRegion(char c) |
boolean |
load(com.badlogic.gdx.assets.AssetManager assetManager) |
GameFontCache |
newCache()
Creates a
GameFontCache for this font |
FontGlyphLayout |
newGlyphLayout()
Creates a
FontGlyphLayout for this font |
void |
setColor(com.badlogic.gdx.graphics.Color color)
Sets the
Color to render the font with |
boolean |
useIntegerPositions()
Returns if characters use integer positions
|
public MonospaceFont(MonospaceFont.FontParameters fontParameters)
public boolean load(com.badlogic.gdx.assets.AssetManager assetManager)
public void draw(Graphics g, java.lang.String str, float x, float y)
GameFontGraphics context using this fontpublic void draw(Graphics g, java.lang.String str, float x, float y, float renderWidth)
GameFontGraphics context using this fontpublic void draw(Graphics g, java.lang.String str, float x, float y, float renderWidth, int horizontalAlignment, boolean wrap)
GameFontGraphics context using this fontdraw in interface GameFontg - The Graphics contextstr - The text to renderx - The x coordinate to draw aty - The y coordinate to draw atrenderWidth - The target width to render withhorizontalAlignment - The horizontal alignment within the targetWidth. See Alignwrap - True if text should wrap if exceeding targetWidth, false if it should clippublic void draw(Graphics g, java.lang.String str, float x, float y, float renderWidth, MonospaceFont.FontRenderListener listener)
public void draw(Graphics g, java.lang.String str, float x, float y, float renderWidth, int horizontalAlignment, boolean wrap, MonospaceFont.FontRenderListener listener)
public void draw(Graphics g, com.badlogic.gdx.utils.Array<MonospaceGlyph> glyphs, float x, float y, MonospaceFont.FontRenderListener listener)
public FontGlyphLayout newGlyphLayout()
GameFontFontGlyphLayout for this fontnewGlyphLayout in interface GameFontFontGlyphLayout instancepublic FontGlyphLayout getSharedGlyphLayout()
GameFontFontGlyphLayout instance associated with this GameFont instancegetSharedGlyphLayout in interface GameFontFontGlyphLayout instance attached to this fontpublic GameFontCache newCache()
GameFontGameFontCache for this fontnewCache in interface GameFontGameFontCache instancepublic com.badlogic.gdx.graphics.Color getColor()
GameFontColor the font will be rendered withpublic void setColor(com.badlogic.gdx.graphics.Color color)
GameFontColor to render the font withpublic float getLineHeight()
GameFontgetLineHeight in interface GameFontpublic float getCapHeight()
GameFontgetCapHeight in interface GameFontpublic TextureRegion getTextureRegion(char c)
public boolean useIntegerPositions()
GameFontuseIntegerPositions in interface GameFontpublic void dispose()
GameFontpublic MonospaceFont.FontParameters getFontParameters()