NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIFont Class Reference

UIFont contains everything needed to be able to print text. More...

Inheritance diagram for UIFont:

Public Member Functions

void MarkAsChanged ()
 Refresh all labels that use this font. More...
 
void UpdateUVRect ()
 Forcefully update the font's sprite reference. More...
 
BMSymbol MatchSymbol (string text, int offset, int textLength)
 Retrieve the symbol at the beginning of the specified sequence, if a match is found. More...
 
void AddSymbol (string sequence, string spriteName)
 Add a new symbol to the font. More...
 
void RemoveSymbol (string sequence)
 Remove the specified symbol from the font. More...
 
void RenameSymbol (string before, string after)
 Change an existing symbol's sequence to the specified value. More...
 
bool UsesSprite (string s)
 Whether the specified sprite is being used by the font. More...
 

Static Public Member Functions

static bool CheckIfRelated (UIFont a, UIFont b)
 Helper function that determines whether the two atlases are related. More...
 

Properties

BMFont bmFont [get, set]
 Access to the BMFont class directly. More...
 
int texWidth [get, set]
 Original width of the font's texture in pixels. More...
 
int texHeight [get, set]
 Original height of the font's texture in pixels. More...
 
bool hasSymbols [get]
 Whether the font has any symbols defined. More...
 
List< BMSymbolsymbols [get]
 List of symbols within the font. More...
 
UIAtlas atlas [get, set]
 Atlas used by the font, if any. More...
 
Material material [get, set]
 Get or set the material used by this font. More...
 
bool premultipliedAlpha [get]
 Whether the font is using a premultiplied alpha material. More...
 
bool premultipliedAlphaShader [get]
 Whether the font is using a premultiplied alpha material. More...
 
bool packedFontShader [get]
 Whether the font is a packed font. More...
 
Texture2D texture [get]
 Convenience function that returns the texture used by the font. More...
 
Rect uvRect [get, set]
 Offset and scale applied to all UV coordinates. More...
 
string spriteName [get, set]
 Sprite used by the font, if any. More...
 
bool isValid [get]
 Whether this is a valid font. More...
 
int size [get, set]
 
int defaultSize [get, set]
 Pixel-perfect size of this font. More...
 
UISpriteData sprite [get]
 Retrieves the sprite used by the font, if any. More...
 
UIFont replacement [get, set]
 Setting a replacement atlas value will cause everything using this font to use the replacement font instead. Suggested use: set up all your widgets to use a dummy font that points to the real font. Switching that font to another one (for example an eastern language one) is then a simple matter of setting this field on your dummy font. More...
 
bool isDynamic [get]
 Whether the font is dynamic. More...
 
Font dynamicFont [get, set]
 Get or set the dynamic font source. More...
 
FontStyle dynamicFontStyle [get, set]
 Get or set the dynamic font's style. More...
 

Detailed Description

UIFont contains everything needed to be able to print text.

Member Function Documentation

void UIFont.AddSymbol ( string  sequence,
string  spriteName 
)

Add a new symbol to the font.

static bool UIFont.CheckIfRelated ( UIFont  a,
UIFont  b 
)
static

Helper function that determines whether the two atlases are related.

void UIFont.MarkAsChanged ( )

Refresh all labels that use this font.

BMSymbol UIFont.MatchSymbol ( string  text,
int  offset,
int  textLength 
)

Retrieve the symbol at the beginning of the specified sequence, if a match is found.

void UIFont.RemoveSymbol ( string  sequence)

Remove the specified symbol from the font.

void UIFont.RenameSymbol ( string  before,
string  after 
)

Change an existing symbol's sequence to the specified value.

void UIFont.UpdateUVRect ( )

Forcefully update the font's sprite reference.

bool UIFont.UsesSprite ( string  s)

Whether the specified sprite is being used by the font.

Property Documentation

UIAtlas UIFont.atlas
getset

Atlas used by the font, if any.

BMFont UIFont.bmFont
getset

Access to the BMFont class directly.

int UIFont.defaultSize
getset

Pixel-perfect size of this font.

Font UIFont.dynamicFont
getset

Get or set the dynamic font source.

FontStyle UIFont.dynamicFontStyle
getset

Get or set the dynamic font's style.

bool UIFont.hasSymbols
get

Whether the font has any symbols defined.

bool UIFont.isDynamic
get

Whether the font is dynamic.

bool UIFont.isValid
get

Whether this is a valid font.

Material UIFont.material
getset

Get or set the material used by this font.

bool UIFont.packedFontShader
get

Whether the font is a packed font.

bool UIFont.premultipliedAlpha
get

Whether the font is using a premultiplied alpha material.

bool UIFont.premultipliedAlphaShader
get

Whether the font is using a premultiplied alpha material.

UIFont UIFont.replacement
getset

Setting a replacement atlas value will cause everything using this font to use the replacement font instead. Suggested use: set up all your widgets to use a dummy font that points to the real font. Switching that font to another one (for example an eastern language one) is then a simple matter of setting this field on your dummy font.

int UIFont.size
getset
UISpriteData UIFont.sprite
get

Retrieves the sprite used by the font, if any.

string UIFont.spriteName
getset

Sprite used by the font, if any.

List<BMSymbol> UIFont.symbols
get

List of symbols within the font.

int UIFont.texHeight
getset

Original height of the font's texture in pixels.

Texture2D UIFont.texture
get

Convenience function that returns the texture used by the font.

int UIFont.texWidth
getset

Original width of the font's texture in pixels.

Rect UIFont.uvRect
getset

Offset and scale applied to all UV coordinates.


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