C# Class tk2dTextMesh, Malisse

Inheritance: MonoBehaviour
Afficher le fichier Open project: Collegiennes/Malisse Class Usage Examples

Méthodes publiques

Свойство Type Description
lineSpacing float
pixelPerfect bool
spacing float

Private Properties

Свойство Type Description
FillTextData int
GetXAnchorForWidth float
GetYAnchorForHeight float

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
OnDestroy ( ) : void

Private Methods

Méthode Description
FillTextData ( ) : int
GetXAnchorForWidth ( float lineWidth ) : float
GetYAnchorForHeight ( float textHeight ) : float

Method Details

Awake() public méthode

public Awake ( ) : void
Résultat void

Commit() public méthode

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
Résultat void

ForceBuild() public méthode

public ForceBuild ( ) : void
Résultat void

FormatText() public méthode

public FormatText ( ) : void
Résultat void

GetMeshDimensionsForString() public méthode

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

Init() public méthode

public Init ( ) : void
Résultat void

Init() public méthode

public Init ( bool force ) : void
force bool
Résultat void

InitInstance() public méthode

public InitInstance ( ) : void
Résultat void

MakePixelPerfect() public méthode

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

NumDrawnCharacters() public méthode

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
Résultat int

NumTotalCharacters() public méthode

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

OnDestroy() protected méthode

protected OnDestroy ( ) : void
Résultat void

PostAlignTextData() public méthode

public PostAlignTextData ( int targetStart, int targetEnd, float offsetX ) : void
targetStart int
targetEnd int
offsetX float
Résultat void

UpdateMaterial() public méthode

public UpdateMaterial ( ) : void
Résultat void

UsesSpriteCollection() public méthode

public UsesSpriteCollection ( tk2dSpriteCollectionData, spriteCollection ) : bool
spriteCollection tk2dSpriteCollectionData,
Résultat 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
Résultat float

pixelPerfect public_oe property

Specifies if this textMesh is kept pixel perfect
public bool pixelPerfect
Résultat 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
Résultat float