Class TextMeshProUGUI
Inherited Members
Namespace: TMPro
Assembly: solution.dll
Syntax
[DisallowMultipleComponent]
[RequireComponent(typeof(RectTransform))]
[RequireComponent(typeof(CanvasRenderer))]
[AddComponentMenu("UI/TextMeshPro - Text (UI)", 11)]
[ExecuteAlways]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.textmeshpro@3.0")]
public class TextMeshProUGUI : TMP_Text, ICanvasElement, IClippable, IMaskable, IMaterialModifier, ILayoutElement
Fields
| Name | Description |
|---|---|
| m_subTextObjects |
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. |
| canvasRenderer | Reference to the CanvasRenderer used by the text object. |
| maskOffset | Sets the masking offset from the bounds of the object |
| materialForRendering | Get the material that will be used for rendering. |
| mesh | Reference to the Mesh used by the text object. |
Methods
| Name | Description |
|---|---|
| Awake() | |
| CalculateLayoutInputHorizontal() | Function called by Unity when the horizontal layout needs to be recalculated. |
| CalculateLayoutInputVertical() | Function called by Unity when the vertical layout needs to be recalculated. |
| ClearMesh() | Function to clear the geometry of the Primary and Sub Text objects. |
| ComputeMarginSize() | Update the margin width and height |
| Cull(Rect, bool) | Override of the Cull function to provide for the ability to override the culling of the text object. |
| 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. |
| GetModifiedMaterial(Material) | |
| 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. |
| InternalCrossFadeAlpha(float, float, bool) | Tweens the alpha of the CanvasRenderer color associated with this Graphic. |
| InternalCrossFadeColor(Color, float, bool, bool) | Tweens the CanvasRenderer color associated with this Graphic. |
| LoadFontAsset() | Method which derived classes need to override to load Font Assets. |
| OnCanvasHierarchyChanged() | |
| OnDestroy() | |
| OnDidApplyAnimationProperties() | |
| OnDisable() | |
| OnEnable() | |
| OnRectTransformDimensionsChange() | |
| OnTransformParentChanged() | |
| Rebuild(CanvasUpdate) | |
| RecalculateClipping() | Method called when the state of a parent changes. |
| SetActiveSubMeshes(bool) | Method to Enable or Disable child SubMesh objects. |
| 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() | |
| SetMaterialDirty() | |
| 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() | |
| 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. |