My Project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
GraphicDNA.BitmapFont Class Reference

Bitmap font class Uses an input Image file with the atlas of characters, and an XML file with the configuration in AngelCode .fnt format (compatible with AngelCode BMFont, ShoeBox, Hiero, etc). Credits for some parts of the code: http://www.angelcode.com/. More...

Public Member Functions

void GetTextVertices (string pText, Vector3 pTextPosition, Vector3 axisX, Vector3 axisY, float pTextHeightWorldCoords, out Vector3[] verts, out Vector2[] texCoords)
 Builds the 3D vertices and texture coords needed to draw text in 2D, using a BitmapFont.
 
void GetTextVertices (string pText, Vector2 pTextPosition, Vector2 pAxisX, Vector2 pAxisY, float pTextHeightWorldCoords, out Vector2[] verts, out Vector2[] texCoords, bool pRightAlign=false)
 Builds the 2D vertices and texture coords needed to draw text in 2D, using a BitmapFont.
 

Static Public Member Functions

static BitmapFont FromXml (TextAsset pFontConfigXmlFile, Texture2D pFontImage)
 

Public Attributes

Texture2D mFontImage
 
int FontSizeToPixelsOffset = 2
 FontSizes differ slightly from pixel sizes, this parameter allows to adjust this offset. A value of 2 means that a fontSize of 18 will be treated internally as 20.
 

Properties

FontInfo Info [get, set]
 
FontCommon Common [get, set]
 
List< FontPagePages [get, set]
 
List< FontCharChars [get, set]
 
List< FontKerningKernings [get, set]
 

Detailed Description

Bitmap font class Uses an input Image file with the atlas of characters, and an XML file with the configuration in AngelCode .fnt format (compatible with AngelCode BMFont, ShoeBox, Hiero, etc). Credits for some parts of the code: http://www.angelcode.com/.

Member Function Documentation

◆ FromXml()

static BitmapFont GraphicDNA.BitmapFont.FromXml ( TextAsset  pFontConfigXmlFile,
Texture2D  pFontImage 
)
inlinestatic
Parameters
pFontConfigXmlFile
pFontImage
Returns

◆ GetTextVertices() [1/2]

void GraphicDNA.BitmapFont.GetTextVertices ( string  pText,
Vector2  pTextPosition,
Vector2  pAxisX,
Vector2  pAxisY,
float  pTextHeightWorldCoords,
out Vector2[]  verts,
out Vector2[]  texCoords,
bool  pRightAlign = false 
)
inline

Builds the 2D vertices and texture coords needed to draw text in 2D, using a BitmapFont.

Parameters
pTextText to be drawn
posPosition of the lower left corner of the text, in 2D
pAxisXRight Axis of the text
pAxisYUp Axis of the text
pTextHeightWorldCoordsText height in world coords
verts
texCoords

◆ GetTextVertices() [2/2]

void GraphicDNA.BitmapFont.GetTextVertices ( string  pText,
Vector3  pTextPosition,
Vector3  axisX,
Vector3  axisY,
float  pTextHeightWorldCoords,
out Vector3[]  verts,
out Vector2[]  texCoords 
)
inline

Builds the 3D vertices and texture coords needed to draw text in 2D, using a BitmapFont.

Parameters
pTextText to be drawn
posPosition of the lower left corner of the text, in 2D
axisXRight Axis of the text
axisYUp Axis of the text
pTextHeightWorldCoordsText height in world coords
verts
texCoords

The documentation for this class was generated from the following file: