class flixel.text.pxText.PxBitmapFont
Available on all platforms
Holds information and bitmap glpyhs for a bitmap font. * @author Johan Peitz * @author Zaphod
Class Fields
static function fetch(PxHandle:String):PxBitmapFont
Retrieves a font previously stored. * *
PxHandle | Identifier of font to fetch. * |
returns | Stored font, or null if no font was found. |
static function store(PxHandle:String, PxFont:PxBitmapFont):Void
Stores a font for global use using an identifier. * *
PxHandle | String identifer for the font. * |
PxFont | Font to store. |
Instance Fields
var numLetters:Int
Returns number of letters available in this font. * *
returns | Number of letters available in this font. |
function getFontData():String
Serializes font data to cryptic bit string. * *
returns | Cryptic string with font as bits. |
function getPreparedGlyphs(PxScale:Float, PxColor:Int, ?PxUseColorTransform:Bool = true):Array<BitmapData>
function getTextWidth(PxText:String, ?PxLetterSpacing:Int = 0, ?PxFontScale:Float = 1):Int
Returns the width of a certain test string. * *
PxText | String to measure. * |
PxLetterSpacing | distance between letters * |
PxFontScale | "size" of the font * |
returns | Width in pixels. |
function loadAngelCode(pBitmapData:BitmapData, pXMLData:Xml):PxBitmapFont
Loads font data in AngelCode's format * *
PxBitmapData | Font image source * |
PxXMLData | Font data in XML format * |
returns | This PxBitmapFont |
function loadPixelizer(PxBitmapData:BitmapData, PxLetters:String):PxBitmapFont
Loads font data in Pixelizer's format * *
PxBitmapData | Font source image * |
PxLetters | All letters contained in this font * |
returns | This PxBitmapFont |
function prepareAngelCodeBitmapData(PxBitmapData:BitmapData, PxXMLData:Xml, PxSymbols:Array<HelperSymbol>):BitmapData
function render(PxBitmapData:BitmapData, PxFontData:Array<BitmapData>, PxText:String, PxColor:Int, PxOffsetX:Int, PxOffsetY:Int, PxLetterSpacing:Int):Void
Renders a string of text onto bitmap data using the font. * *
PxBitmapData | Where to render the text. * |
PxText | Test to render. * |
PxColor | Color of text to render. * |
PxOffsetX | X position of thext output. * |
PxOffsetY | Y position of thext output. |
function updateGlyphData(?Tiles:TileSheetData = null):Void
Updates and caches tile data for passed node object