Given a Font object and a text containing all the characters you intend to use, FontMap creates a Texture2D object containg the characters and its corresponding table of UVs. More...
Classes | |
struct | CharData |
The UV data for a single character. More... | |
Public Member Functions | |
FontMap (Font font, int fontmap_width=512) | |
Create a FontMap for the ASCII char set. | |
FontMap (Font font, string charset, int fontmap_width=512) | |
void | Dispose () |
Dispose implementation. | |
void | Initialize (Font font, string charset, int fontmap_width=512) |
bool | TryGetCharData (char c, out CharData cdata) |
Try to get the CharData needed to draw the character 'c'. | |
Public Attributes | |
Texture2D | Texture |
The font texture containing all the characters. | |
Dictionary< char, CharData > | CharSet |
Map characters to their corresponding CharData (UV and size data). | |
float | CharPixelHeight |
Character height in pixels - all characters have the same pixel height. | |
Static Public Attributes | |
static string | AsciiCharSet = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" |
The ascii character set as a string. | |
Properties | |
bool | Disposed [get] |
Return true if this object been disposed. |
Given a Font object and a text containing all the characters you intend to use, FontMap creates a Texture2D object containg the characters and its corresponding table of UVs.
This data is used by GameEngine2D in various text rendering functions.
Examples:
new FontMap( new Font( "D:\\Blah\\YourFont.TTF", 32, FontStyle.Bold ), 512 );
new FontMap( new Font( FontAlias.System, 32, FontStyle.Bold ), 512 );
void Initialize | ( | Font | font, |
string | charset, | ||
int | fontmap_width = 512 |
||
) |