Fork me on GitHub
View source

package haxepunk.graphics.text

class BitmapFontAtlas


extends TextureAtlas
implements IBitmapFont

TextureAtlas which supports parsing various bitmap font formats. Used by BitmapFont.


Available since:

2.5.0

Static functions

View source

static getFont (fontName : String, format : BitmapFontFormat, extraParams : Dynamic) : BitmapFontAtlas

Loads a bitmap font, returning a BitmapFontAtlas. The first time a font is loaded, it is cached for later use.


Parameters:
fontName   

The path to a .fnt bitmap font description.

format   

An enum specifying the font format. Default is Sparrow XML format.

extraParams   

Additional parameters to pass to the format-specific load() function.

View source

static loadXMLFont (file : String) : BitmapFontAtlas

Load a font from Sparrow (or BMFont) XML format.

View source

static loadXNAFont (asset : String, options : Dynamic) : BitmapFontAtlas

Load a font from XNA/BMFont format.


Parameters:
asset   

An asset

options   

An object containing optional parameters letters String of glyphs contained in the asset, in order (ex. " abcdefghijklmnopqrstuvwxyz"). Defaults to _DEFAULT_GLYPHS. glyphBGColor An additional background color to remove. Defaults to 0xFF202020, often used for glyphs background.


Available since:

2.5.3

Variables

fontSize : Int

glyphData : Map<String, GlyphData>

lineHeight : Int

Functions

View source

getChar (name : String, size : Float) : GlyphData

View source

getLineHeight (size : Float) : Float