C# Class tk2dTextMesh, Malisse

Inheritance: MonoBehaviour
显示文件 Open project: Collegiennes/Malisse Class Usage Examples

Public Properties

Property Type Description
lineSpacing float
pixelPerfect bool
spacing float

Private Properties

Property Type Description
FillTextData int
GetXAnchorForWidth float
GetYAnchorForHeight float

Public Methods

Method Description
Awake ( ) : void
Commit ( ) : void

Call commit after changing properties to commit the changes. This is deffered to a commit call as more than one operation may require rebuilding the buffers, eg. scaling and changing text. This will be wasteful if performed multiple times.

ForceBuild ( ) : void
FormatText ( ) : void
GetMeshDimensionsForString ( string str ) : Vector2

Calculates the mesh dimensions for the given string and returns a width and height.

Init ( ) : void
Init ( bool force ) : void
InitInstance ( ) : void
MakePixelPerfect ( ) : void

Makes the text mesh pixel perfect to the active camera. Automatically detects tk2dCamera if present Otherwise uses Camera.main

NumDrawnCharacters ( ) : int

Returns the number of characters drawn for the currently active string. This may be less than string.Length - some characters are used as escape codes for switching texture gradient ^0-^9 Also, there might be more characters in the string than have been allocated for the textmesh, in which case the string will be truncated.

NumTotalCharacters ( ) : int

Returns the number of characters excluding texture gradient escape codes.

PostAlignTextData ( int targetStart, int targetEnd, float offsetX ) : void
UpdateMaterial ( ) : void
UsesSpriteCollection ( tk2dSpriteCollectionData, spriteCollection ) : bool

Protected Methods

Method Description
OnDestroy ( ) : void

Private Methods

Method Description
FillTextData ( ) : int
GetXAnchorForWidth ( float lineWidth ) : float
GetYAnchorForHeight ( float textHeight ) : float

Method Details

Awake() public method

public Awake ( ) : void
return void

Commit() public method

Call commit after changing properties to commit the changes. This is deffered to a commit call as more than one operation may require rebuilding the buffers, eg. scaling and changing text. This will be wasteful if performed multiple times.
public Commit ( ) : void
return void

ForceBuild() public method

public ForceBuild ( ) : void
return void

FormatText() public method

public FormatText ( ) : void
return void

GetMeshDimensionsForString() public method

Calculates the mesh dimensions for the given string and returns a width and height.
public GetMeshDimensionsForString ( string str ) : Vector2
str string
return Vector2

Init() public method

public Init ( ) : void
return void

Init() public method

public Init ( bool force ) : void
force bool
return void

InitInstance() public method

public InitInstance ( ) : void
return void

MakePixelPerfect() public method

Makes the text mesh pixel perfect to the active camera. Automatically detects tk2dCamera if present Otherwise uses Camera.main
public MakePixelPerfect ( ) : void
return void

NumDrawnCharacters() public method

Returns the number of characters drawn for the currently active string. This may be less than string.Length - some characters are used as escape codes for switching texture gradient ^0-^9 Also, there might be more characters in the string than have been allocated for the textmesh, in which case the string will be truncated.
public NumDrawnCharacters ( ) : int
return int

NumTotalCharacters() public method

Returns the number of characters excluding texture gradient escape codes.
public NumTotalCharacters ( ) : int
return int

OnDestroy() protected method

protected OnDestroy ( ) : void
return void

PostAlignTextData() public method

public PostAlignTextData ( int targetStart, int targetEnd, float offsetX ) : void
targetStart int
targetEnd int
offsetX float
return void

UpdateMaterial() public method

public UpdateMaterial ( ) : void
return void

UsesSpriteCollection() public method

public UsesSpriteCollection ( tk2dSpriteCollectionData, spriteCollection ) : bool
spriteCollection tk2dSpriteCollectionData,
return bool

Property Details

lineSpacing public_oe property

Deprecated: Use LineSpacing instead. Additional line spacing for multiline text. This can be negative to bring lines closer together. This is in font local space.
public float lineSpacing
return float

pixelPerfect public_oe property

Specifies if this textMesh is kept pixel perfect
public bool pixelPerfect
return bool

spacing public_oe property

Deprecated: Use Spacing instead. Additional spacing between characters. This can be negative to bring characters closer together. This is in the font local space.
public float spacing
return float