Class TextMeshPro
Inherited Members
Namespace: TMPro
Assembly: solution.dll
Syntax
[DisallowMultipleComponent]
[RequireComponent(typeof(MeshRenderer))]
[AddComponentMenu("Mesh/TextMeshPro - Text")]
[ExecuteAlways]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.textmeshpro@3.0")]
public class TextMeshPro : TMP_Text, ICanvasElement, IClippable, IMaskable, IMaterialModifier, ILayoutElement
Properties
| Name | Description |
|---|---|
| autoSizeTextContainer | Determines if the size of the text container will be adjusted to fit the text object when it is first created. |
| maskType | Sets the mask type |
| mesh | Returns the mesh assigned to the text object. |
| meshFilter | Returns the Mesh Filter of the text object. |
| renderer | Returns the rendered assigned to the text object. |
| sortingLayerID | Sets the Renderer's sorting Layer ID |
| sortingOrder | Sets the Renderer's sorting order within the assigned layer. |
| textContainer | Returns a reference to the Text Container |
| transform | Returns a reference to the Transform |
Methods
| Name | Description |
|---|---|
| Awake() | |
| CalculateLayoutInputHorizontal() | |
| CalculateLayoutInputVertical() | |
| ClearMesh(bool) | Function to clear the geometry of the Primary and Sub Text objects. |
| ComputeMarginSize() | Update the margin width and height |
| DestroySubMeshObjects() | Destroy Sub Mesh Objects |
| ForceMeshUpdate(bool, bool) | Function to force regeneration of the text object before its normal process time. This is useful when changes to the text object properties need to be applied immediately. |
| GenerateTextMesh() | This is the main function that is responsible for creating / displaying the text. |
| GetCompoundBounds() | Method returning the compound bounds of the text object and child sub objects. |
| GetMaterial(Material) | Function called internally when a new material is assigned via the fontMaterial property. |
| GetMaterials(Material[]) | Method returning instances of the materials used by the text object. |
| GetSharedMaterials() | Method returning an array containing the materials used by the text object. |
| GetTextContainerLocalCorners() | Method to return the local corners of the Text Container or RectTransform. |
| GetTextInfo(string) | Function used to evaluate the length of a text string. |
| LoadFontAsset() | Method which derived classes need to override to load Font Assets. |
| OnDestroy() | |
| OnDidApplyAnimationProperties() | |
| OnDisable() | |
| OnEnable() | |
| OnRectTransformDimensionsChange() | |
| OnTransformParentChanged() | |
| Rebuild(CanvasUpdate) | |
| SetActiveSubMeshes(bool) | Method to Enable or Disable child SubMesh objects. |
| SetActiveSubTextObjectRenderers(bool) | |
| SetAllDirty() | |
| SetArraySizes(UnicodeChar[]) | Method used to determine the number of visible characters and required buffer allocations. |
| SetCulling() | Set the culling mode on the material. |
| SetFaceColor(Color32) | Function called internally to set the face color of the material. This will results in an instance of the material. |
| SetLayoutDirty() | |
| SetMask(MaskingTypes, Vector4) | Function used to set the mask type and coordinates in World Space |
| SetMask(MaskingTypes, Vector4, float, float) | Function used to set the mask type, coordinates and softness |
| SetMaterialDirty() | Schedule updating of the material used by the text object. |
| SetOutlineColor(Color32) | Function called internally to set the outline color of the material. This will results in an instance of the material. |
| SetOutlineThickness(float) | Function called internally to set the outline thickness property of the material. This will results in an instance of the material. |
| SetShaderDepth() | Set the Render Queue and ZTest mode on the current material |
| SetSharedMaterial(Material) | Function called internally when a new shared material is assigned via the fontSharedMaterial property. |
| SetSharedMaterials(Material[]) | Method used to assign new materials to the text and sub text objects. |
| SetVerticesDirty() | Schedule rebuilding of the text geometry. |
| UpdateFontAsset() | |
| UpdateGeometry(Mesh, int) | Function to update the geometry of the main and sub text objects. |
| UpdateMaterial() | |
| UpdateMeshPadding() | Function to be used to force recomputing of character padding when Shader / Material properties have been changed via script. |
| UpdateVertexData() | Function to upload the updated vertex data and renderer. |
| UpdateVertexData(TMP_VertexDataUpdateFlags) | Function to upload the updated vertex data and renderer. |
Events
| Name | Description |
|---|---|
| OnPreRenderText | Event to allow users to modify the content of the text info before the text is rendered. |