Class CharData
- Namespace
- TMPEffects.CharacterData
Represents a TextMeshPro character, allowing you to make modifications to its appearance.
Primarily used by TMPAnimator and its animations to animate a character.
When used in that manner, modifications made to it (e.g. by using SetPosition(Vector3), or directly modifying the CharacterModifiers),
will be applied by the animator to the actual mesh of the character.
public class CharData
- Inheritance
-
CharData
- Inherited Members
Constructors
CharData(int, TMP_CharacterInfo, int)
public CharData(int index, TMP_CharacterInfo cInfo, int wordIndex)
Parameters
CharData(int, TMP_CharacterInfo, int, TMP_WordInfo?)
public CharData(int index, TMP_CharacterInfo cInfo, int wordIndex, TMP_WordInfo? wInfo = null)
Parameters
Fields
defaultRotation
The default rotation of any CharData.
public static readonly Quaternion defaultRotation
Field Value
- Quaternion
defaultScale
The default scale of any CharData.
public static readonly Vector3 defaultScale
Field Value
- Vector3
info
Holds a selection of TMP_CharacterInfo data.
public readonly CharData.Info info
Field Value
mesh
The mesh of the character.
public readonly VertexData mesh
Field Value
Properties
CharacterModifiers
The character modifiers of this character.
public TMPCharacterModifiers CharacterModifiers { get; }
Property Value
InitialMesh
The initial mesh of this character.
public ReadOnlyVertexData InitialMesh { get; }
Property Value
InitialPosition
The initial position of this character.
public Vector3 InitialPosition { get; }
Property Value
- Vector3
InitialRotation
The initial rotation of this character.
public Quaternion InitialRotation { get; }
Property Value
- Quaternion
InitialScale
The initial scale of this character.
public Vector3 InitialScale { get; }
Property Value
- Vector3
MeshModifiers
The mesh modifiers of this character.
public TMPMeshModifiers MeshModifiers { get; }
Property Value
Position
The character's position.
public Vector3 Position { get; set; }
Property Value
- Vector3
PositionDelta
The character's position delta (offset from InitialPosition).
public Vector3 PositionDelta { get; set; }
Property Value
- Vector3
Rotations
The character's rotations.
Modify using AddRotation(Vector3, Vector3), RemoveRotation(int), ClearRotations().
public IReadOnlyList<Rotation> Rotations { get; }
Property Value
Scale
The character's scale.
public Vector3 Scale { get; set; }
Property Value
- Vector3
alphasDirty
Whether the vertex alphas have been manipulated.
public bool alphasDirty { get; }
Property Value
colorsDirty
Whether the vertex colors have been manipulated.
public bool colorsDirty { get; }
Property Value
positionDirty
Whether the position has been manipulated from the character's initial position.
public bool positionDirty { get; }
Property Value
rotationDirty
Whether the rotation has been manipulated from the character's initial rotation.
public bool rotationDirty { get; }
Property Value
scaleDirty
Whether the scale has been manipulated from the character's initial scale.
public bool scaleDirty { get; }
Property Value
uvsDirty
Whether the UVs have been manipulated.
public bool uvsDirty { get; }
Property Value
verticesDirty
Whether the vertices have been manipulated.
public bool verticesDirty { get; }
Property Value
Methods
AddRotation(Vector3, Vector3)
Add a rotation to the character.
public void AddRotation(Vector3 eulerAngles, Vector3 pivot)
Parameters
eulerAngles
Vector3The euler angles to rotate by.
pivot
Vector3The pivot to rotate around.
ClearPosition()
Reset the position of the character back to InitialPosition.
public void ClearPosition()
ClearRotations()
Clear all rotations of this character, effectively setting its rotation back to InitialRotation.
public void ClearRotations()
ClearScale()
Reset the scale of this character back to InitialScale.
public void ClearScale()
InsertRotation(int, Vector3, Vector3)
Add a rotation to the character.
public void InsertRotation(int index, Vector3 eulerAngles, Vector3 pivot)
Parameters
index
intThe index in Rotations to insert into.
eulerAngles
Vector3The euler angles to rotate by.
pivot
Vector3The pivot to rotate around.
RemoveRotation(int)
Remove a rotation from the character.
public void RemoveRotation(int index)
Parameters
Reset()
Reset all changes made to the character (mesh, position, rotation, scale and pivot).
public void Reset()
SetPosition(Vector3)
Set the position of the character.
public void SetPosition(Vector3 position)
Parameters
position
Vector3
SetPositionDelta(Vector3)
Set the position delta of the character (offset from InitialPosition).
public void SetPositionDelta(Vector3 delta)
Parameters
delta
Vector3
SetScale(Vector3)
Set the scale of this character.
public void SetScale(Vector3 scale)
Parameters
scale
Vector3The new scale of this character.