C# 클래스 UIFont, DsynBio

상속: MonoBehaviour
파일 보기 프로젝트 열기: CyberCRI/DsynBio 1 사용 예제들

공개 메소드들

메소드 설명
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).

비공개 메소드들

메소드 설명
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.

메소드 상세

AddSymbol() 공개 메소드

Add a new symbol to the font.
public AddSymbol ( string sequence, string spriteName ) : void
sequence string
spriteName string
리턴 void

CalculatePrintedSize() 공개 메소드

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
리턴 Vector2

CheckIfRelated() 공개 정적인 메소드

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

GetEndOfLineThatFits() 공개 메소드

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
리턴 string

MarkAsDirty() 공개 메소드

Refresh all labels that use this font.
public MarkAsDirty ( ) : void
리턴 void

Print() 공개 메소드

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
리턴 void

RemoveSymbol() 공개 메소드

Remove the specified symbol from the font.
public RemoveSymbol ( string sequence ) : void
sequence string
리턴 void

RenameSymbol() 공개 메소드

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

UsesSprite() 공개 메소드

Whether the specified sprite is being used by the font.
public UsesSprite ( string s ) : bool
s string
리턴 bool

WrapText() 공개 메소드

Text wrapping functionality. Legacy compatibility function.
public WrapText ( string text, float maxWidth, int maxLineCount ) : string
text string
maxWidth float
maxLineCount int
리턴 string

WrapText() 공개 메소드

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
리턴 string

WrapText() 공개 메소드

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
리턴 string