Method | Description | |
---|---|---|
AddSymbol ( string sequence, string spriteName ) : void |
Add a new symbol to the font.
|
|
CalculatePrintedSize ( string text, bool encoding, SymbolStyle symbolStyle ) : Vector2 |
Get the printed size of the specified string. The returned value is in local coordinates. Multiply by transform's scale to get pixels.
|
|
CheckIfRelated ( UIFont, a, UIFont, b ) : bool |
Helper function that determines whether the two atlases are related.
|
|
GetEndOfLineThatFits ( string text, float maxWidth, bool encoding, SymbolStyle symbolStyle ) : string |
Different line wrapping functionality -- contributed by MightyM. http://www.tasharen.com/forum/index.php?topic=1049.0
|
|
MarkAsDirty ( ) : void |
Refresh all labels that use this font.
|
|
Print ( string text, |
Print the specified text into the buffers. Note: 'lineWidth' parameter should be in pixels.
|
|
RemoveSymbol ( string sequence ) : void |
Remove the specified symbol from the font.
|
|
RenameSymbol ( string before, string after ) : void |
Change an existing symbol's sequence to the specified value.
|
|
UsesSprite ( string s ) : bool |
Whether the specified sprite is being used by the font.
|
|
WrapText ( string text, float maxWidth, int maxLineCount ) : string |
Text wrapping functionality. Legacy compatibility function.
|
|
WrapText ( string text, float maxWidth, int maxLineCount, bool encoding ) : string |
Text wrapping functionality. Legacy compatibility function.
|
|
WrapText ( string text, float maxWidth, int maxLineCount, bool encoding, SymbolStyle symbolStyle ) : string |
Text wrapping functionality. The 'maxWidth' should be in local coordinates (take pixels and divide them by transform's scale).
|
Method | Description | |
---|---|---|
Align ( BetterList |
Align the vertices to be right or center-aligned given the specified line width.
|
|
EndLine ( StringBuilder &s ) : void |
Convenience function that ends the line by either appending a new line character or replacing a space with one.
|
|
GetSymbol ( string sequence, bool createIfMissing ) : BMSymbol, |
Retrieve the specified symbol, optionally creating it if it's missing.
|
|
MatchSymbol ( string text, int offset, int textLength ) : BMSymbol, |
Retrieve the symbol at the beginning of the specified sequence, if a match is found.
|
|
References ( UIFont, font ) : bool |
Helper function that determines whether the font uses the specified one, taking replacements into account.
|
|
Trim ( ) : void |
Trim the glyphs, making sure they never go past the trimmed texture bounds.
|
public AddSymbol ( string sequence, string spriteName ) : void | ||
sequence | string | |
spriteName | string | |
return | void |
public CalculatePrintedSize ( string text, bool encoding, SymbolStyle symbolStyle ) : Vector2 | ||
text | string | |
encoding | bool | |
symbolStyle | SymbolStyle | |
return | Vector2 |
public static CheckIfRelated ( UIFont, a, UIFont, b ) : bool | ||
a | UIFont, | |
b | UIFont, | |
return | bool |
public GetEndOfLineThatFits ( string text, float maxWidth, bool encoding, SymbolStyle symbolStyle ) : string | ||
text | string | |
maxWidth | float | |
encoding | bool | |
symbolStyle | SymbolStyle | |
return | string |
public Print ( string text, |
||
text | string | |
color | ||
verts | BetterList |
|
uvs | BetterList |
|
cols | BetterList |
|
encoding | bool | |
symbolStyle | SymbolStyle | |
alignment | Alignment, | |
lineWidth | int | |
premultiply | bool | |
return | void |
public RemoveSymbol ( string sequence ) : void | ||
sequence | string | |
return | void |
public RenameSymbol ( string before, string after ) : void | ||
before | string | |
after | string | |
return | void |
public WrapText ( string text, float maxWidth, int maxLineCount ) : string | ||
text | string | |
maxWidth | float | |
maxLineCount | int | |
return | string |
public WrapText ( string text, float maxWidth, int maxLineCount, bool encoding ) : string | ||
text | string | |
maxWidth | float | |
maxLineCount | int | |
encoding | bool | |
return | string |
public WrapText ( string text, float maxWidth, int maxLineCount, bool encoding, SymbolStyle symbolStyle ) : string | ||
text | string | |
maxWidth | float | |
maxLineCount | int | |
encoding | bool | |
symbolStyle | SymbolStyle | |
return | string |