C# Class SparrowSharp.Fonts.BitmapFont

The BitmapFont class parses bitmap font files and arranges the glyphs in the form of a text. The class parses the XML format as it is used in the AngelCode Bitmap Font Generator. This is what the file format looks like: _You don't have to use this class directly in most cases. TextField contains methods that handle bitmap fonts for you._
Datei anzeigen Open project: fmotagarcia/sparrow-sharp Class Usage Examples

Public Methods

Method Description
BitmapFont ( ) : System

Initializes a new instance with an embedded mini font. This font's characters have a height of 5 pixels and a maximum width of 5 pixels.

BitmapFont ( Stream fontTextureData, Stream fontXmlData ) : System
CharById ( int charId ) : BitmapChar

Returns a single bitmap char with a certain character ID.

FillQuadBatch ( QuadBatch quadBatch, float width, float height, string text, float size, uint color, HAlign hAlign, VAlign vAlign, bool autoScale, bool kerning ) : void

Draws text into a quad batch.

Private Methods

Method Description
ArrangeCharsInArea ( float width, float height, string text, float size, HAlign hAlign, VAlign vAlign, bool autoScale, bool kerning ) : List
ParseAndLoadChars ( XmlDocument xml, float scale ) : void
ParseAndLoadCommon ( XmlDocument xml ) : void
ParseAndLoadInfo ( XmlDocument xml ) : void
ParseAndLoadKerning ( XmlDocument xml, float scale ) : void
ParseFontData ( Stream fontTextureData, Stream fontXmlData ) : void
TextureReferencedByXmlData ( TextureLoader textureLoader, Stream fontXmlData ) : Texture

Method Details

BitmapFont() public method

Initializes a new instance with an embedded mini font. This font's characters have a height of 5 pixels and a maximum width of 5 pixels.
public BitmapFont ( ) : System
return System

BitmapFont() public method

public BitmapFont ( Stream fontTextureData, Stream fontXmlData ) : System
fontTextureData Stream
fontXmlData Stream
return System

CharById() public method

Returns a single bitmap char with a certain character ID.
public CharById ( int charId ) : BitmapChar
charId int
return BitmapChar

FillQuadBatch() public method

Draws text into a quad batch.
public FillQuadBatch ( QuadBatch quadBatch, float width, float height, string text, float size, uint color, HAlign hAlign, VAlign vAlign, bool autoScale, bool kerning ) : void
quadBatch Sparrow.Display.QuadBatch
width float
height float
text string
size float
color uint
hAlign HAlign
vAlign VAlign
autoScale bool
kerning bool
return void