C# Класс tk2dTextMesh, Malisse

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
lineSpacing float
pixelPerfect bool
spacing float

Private Properties

Свойство Тип Описание
FillTextData int
GetXAnchorForWidth float
GetYAnchorForHeight float

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
OnDestroy ( ) : void

Приватные методы

Метод Описание
FillTextData ( ) : int
GetXAnchorForWidth ( float lineWidth ) : float
GetYAnchorForHeight ( float textHeight ) : float

Описание методов

Awake() публичный Метод

public Awake ( ) : void
Результат void

Commit() публичный Метод

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
Результат void

ForceBuild() публичный Метод

public ForceBuild ( ) : void
Результат void

FormatText() публичный Метод

public FormatText ( ) : void
Результат void

GetMeshDimensionsForString() публичный Метод

Calculates the mesh dimensions for the given string and returns a width and height.
public GetMeshDimensionsForString ( string str ) : Vector2
str string
Результат Vector2

Init() публичный Метод

public Init ( ) : void
Результат void

Init() публичный Метод

public Init ( bool force ) : void
force bool
Результат void

InitInstance() публичный Метод

public InitInstance ( ) : void
Результат void

MakePixelPerfect() публичный Метод

Makes the text mesh pixel perfect to the active camera. Automatically detects tk2dCamera if present Otherwise uses Camera.main
public MakePixelPerfect ( ) : void
Результат void

NumDrawnCharacters() публичный Метод

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
Результат int

NumTotalCharacters() публичный Метод

Returns the number of characters excluding texture gradient escape codes.
public NumTotalCharacters ( ) : int
Результат int

OnDestroy() защищенный Метод

protected OnDestroy ( ) : void
Результат void

PostAlignTextData() публичный Метод

public PostAlignTextData ( int targetStart, int targetEnd, float offsetX ) : void
targetStart int
targetEnd int
offsetX float
Результат void

UpdateMaterial() публичный Метод

public UpdateMaterial ( ) : void
Результат void

UsesSpriteCollection() публичный Метод

public UsesSpriteCollection ( tk2dSpriteCollectionData, spriteCollection ) : bool
spriteCollection tk2dSpriteCollectionData,
Результат bool

Описание свойств

lineSpacing публичное свойство

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
Результат float

pixelPerfect публичное свойство

Specifies if this textMesh is kept pixel perfect
public bool pixelPerfect
Результат bool

spacing публичное свойство

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
Результат float