C# Class UIFont, DsynBio

Inheritance: MonoBehaviour
Afficher le fichier Open project: CyberCRI/DsynBio Class Usage Examples

Méthodes publiques

Méthode 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, Color32 color, BetterList verts, BetterList uvs, BetterList cols, bool encoding, SymbolStyle symbolStyle, Alignment, alignment, int lineWidth, bool premultiply ) : void

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).

Private Methods

Méthode Description
Align ( BetterList verts, int indexOffset, Alignment, alignment, int x, int lineWidth ) : void

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.

Method Details

AddSymbol() public méthode

Add a new symbol to the font.
public AddSymbol ( string sequence, string spriteName ) : void
sequence string
spriteName string
Résultat void

CalculatePrintedSize() public méthode

Get the printed size of the specified string. The returned value is in local coordinates. Multiply by transform's scale to get pixels.
public CalculatePrintedSize ( string text, bool encoding, SymbolStyle symbolStyle ) : Vector2
text string
encoding bool
symbolStyle SymbolStyle
Résultat Vector2

CheckIfRelated() public static méthode

Helper function that determines whether the two atlases are related.
public static CheckIfRelated ( UIFont, a, UIFont, b ) : bool
a UIFont,
b UIFont,
Résultat bool

GetEndOfLineThatFits() public méthode

Different line wrapping functionality -- contributed by MightyM. http://www.tasharen.com/forum/index.php?topic=1049.0
public GetEndOfLineThatFits ( string text, float maxWidth, bool encoding, SymbolStyle symbolStyle ) : string
text string
maxWidth float
encoding bool
symbolStyle SymbolStyle
Résultat string

MarkAsDirty() public méthode

Refresh all labels that use this font.
public MarkAsDirty ( ) : void
Résultat void

Print() public méthode

Print the specified text into the buffers. Note: 'lineWidth' parameter should be in pixels.
public Print ( string text, Color32 color, BetterList verts, BetterList uvs, BetterList cols, bool encoding, SymbolStyle symbolStyle, Alignment, alignment, int lineWidth, bool premultiply ) : void
text string
color UnityEngine.Color32
verts BetterList
uvs BetterList
cols BetterList
encoding bool
symbolStyle SymbolStyle
alignment Alignment,
lineWidth int
premultiply bool
Résultat void

RemoveSymbol() public méthode

Remove the specified symbol from the font.
public RemoveSymbol ( string sequence ) : void
sequence string
Résultat void

RenameSymbol() public méthode

Change an existing symbol's sequence to the specified value.
public RenameSymbol ( string before, string after ) : void
before string
after string
Résultat void

UsesSprite() public méthode

Whether the specified sprite is being used by the font.
public UsesSprite ( string s ) : bool
s string
Résultat bool

WrapText() public méthode

Text wrapping functionality. Legacy compatibility function.
public WrapText ( string text, float maxWidth, int maxLineCount ) : string
text string
maxWidth float
maxLineCount int
Résultat string

WrapText() public méthode

Text wrapping functionality. Legacy compatibility function.
public WrapText ( string text, float maxWidth, int maxLineCount, bool encoding ) : string
text string
maxWidth float
maxLineCount int
encoding bool
Résultat string

WrapText() public méthode

Text wrapping functionality. The 'maxWidth' should be in local coordinates (take pixels and divide them by transform's scale).
public WrapText ( string text, float maxWidth, int maxLineCount, bool encoding, SymbolStyle symbolStyle ) : string
text string
maxWidth float
maxLineCount int
encoding bool
symbolStyle SymbolStyle
Résultat string