docs.unity3d.com
    Show / Hide Table of Contents

    Class TextMeshProUGUI

    Inheritance
    System.Object
    UnityEngine.EventSystems.UIBehaviour
    UnityEngine.UI.Graphic
    UnityEngine.UI.MaskableGraphic
    TMP_Text
    TextMeshProUGUI
    Inherited Members
    TMP_Text.text
    TMP_Text.m_text
    TMP_Text.isRightToLeftText
    TMP_Text.m_isRightToLeft
    TMP_Text.font
    TMP_Text.m_fontAsset
    TMP_Text.m_currentFontAsset
    TMP_Text.m_isSDFShader
    TMP_Text.fontSharedMaterial
    TMP_Text.m_sharedMaterial
    TMP_Text.m_currentMaterial
    TMP_Text.m_materialReferences
    TMP_Text.m_materialReferenceIndexLookup
    TMP_Text.m_materialReferenceStack
    TMP_Text.m_currentMaterialIndex
    TMP_Text.fontSharedMaterials
    TMP_Text.m_fontSharedMaterials
    TMP_Text.fontMaterial
    TMP_Text.m_fontMaterial
    TMP_Text.fontMaterials
    TMP_Text.m_fontMaterials
    TMP_Text.m_isMaterialDirty
    TMP_Text.color
    TMP_Text.m_fontColor32
    TMP_Text.m_fontColor
    TMP_Text.s_colorWhite
    TMP_Text.m_underlineColor
    TMP_Text.m_strikethroughColor
    TMP_Text.m_highlightColor
    TMP_Text.alpha
    TMP_Text.enableVertexGradient
    TMP_Text.m_enableVertexGradient
    TMP_Text.colorGradient
    TMP_Text.m_fontColorGradient
    TMP_Text.colorGradientPreset
    TMP_Text.m_fontColorGradientPreset
    TMP_Text.spriteAsset
    TMP_Text.m_spriteAsset
    TMP_Text.tintAllSprites
    TMP_Text.m_tintAllSprites
    TMP_Text.m_tintSprite
    TMP_Text.m_spriteColor
    TMP_Text.overrideColorTags
    TMP_Text.m_overrideHtmlColors
    TMP_Text.faceColor
    TMP_Text.m_faceColor
    TMP_Text.outlineColor
    TMP_Text.m_outlineColor
    TMP_Text.outlineWidth
    TMP_Text.m_outlineWidth
    TMP_Text.fontSize
    TMP_Text.m_fontSize
    TMP_Text.m_currentFontSize
    TMP_Text.m_fontSizeBase
    TMP_Text.m_sizeStack
    TMP_Text.fontScale
    TMP_Text.fontWeight
    TMP_Text.m_fontWeight
    TMP_Text.m_fontWeightInternal
    TMP_Text.m_fontWeightStack
    TMP_Text.pixelsPerUnit
    TMP_Text.enableAutoSizing
    TMP_Text.m_enableAutoSizing
    TMP_Text.m_maxFontSize
    TMP_Text.m_minFontSize
    TMP_Text.fontSizeMin
    TMP_Text.m_fontSizeMin
    TMP_Text.fontSizeMax
    TMP_Text.m_fontSizeMax
    TMP_Text.fontStyle
    TMP_Text.m_fontStyle
    TMP_Text.m_style
    TMP_Text.m_fontStyleStack
    TMP_Text.isUsingBold
    TMP_Text.m_isUsingBold
    TMP_Text.alignment
    TMP_Text.m_textAlignment
    TMP_Text.m_lineJustification
    TMP_Text.m_lineJustificationStack
    TMP_Text.m_textContainerLocalCorners
    TMP_Text.m_isAlignmentEnumConverted
    TMP_Text.characterSpacing
    TMP_Text.m_characterSpacing
    TMP_Text.m_cSpacing
    TMP_Text.m_monoSpacing
    TMP_Text.wordSpacing
    TMP_Text.m_wordSpacing
    TMP_Text.lineSpacing
    TMP_Text.m_lineSpacing
    TMP_Text.m_lineSpacingDelta
    TMP_Text.m_lineHeight
    TMP_Text.lineSpacingAdjustment
    TMP_Text.m_lineSpacingMax
    TMP_Text.paragraphSpacing
    TMP_Text.m_paragraphSpacing
    TMP_Text.characterWidthAdjustment
    TMP_Text.m_charWidthMaxAdj
    TMP_Text.m_charWidthAdjDelta
    TMP_Text.enableWordWrapping
    TMP_Text.m_enableWordWrapping
    TMP_Text.m_isCharacterWrappingEnabled
    TMP_Text.m_isNonBreakingSpace
    TMP_Text.m_isIgnoringAlignment
    TMP_Text.wordWrappingRatios
    TMP_Text.m_wordWrappingRatios
    TMP_Text.overflowMode
    TMP_Text.m_overflowMode
    TMP_Text.isTextOverflowing
    TMP_Text.firstOverflowCharacterIndex
    TMP_Text.m_firstOverflowCharacterIndex
    TMP_Text.linkedTextComponent
    TMP_Text.m_linkedTextComponent
    TMP_Text.isLinkedTextComponent
    TMP_Text.m_isLinkedTextComponent
    TMP_Text.isTextTruncated
    TMP_Text.m_isTextTruncated
    TMP_Text.enableKerning
    TMP_Text.m_enableKerning
    TMP_Text.extraPadding
    TMP_Text.m_enableExtraPadding
    TMP_Text.checkPaddingRequired
    TMP_Text.richText
    TMP_Text.m_isRichText
    TMP_Text.parseCtrlCharacters
    TMP_Text.m_parseCtrlCharacters
    TMP_Text.isOverlay
    TMP_Text.m_isOverlay
    TMP_Text.isOrthographic
    TMP_Text.m_isOrthographic
    TMP_Text.enableCulling
    TMP_Text.m_isCullingEnabled
    TMP_Text.ignoreRectMaskCulling
    TMP_Text.m_ignoreRectMaskCulling
    TMP_Text.ignoreVisibility
    TMP_Text.m_ignoreCulling
    TMP_Text.horizontalMapping
    TMP_Text.m_horizontalMapping
    TMP_Text.verticalMapping
    TMP_Text.m_verticalMapping
    TMP_Text.mappingUvLineOffset
    TMP_Text.m_uvLineOffset
    TMP_Text.renderMode
    TMP_Text.m_renderMode
    TMP_Text.geometrySortingOrder
    TMP_Text.m_geometrySortingOrder
    TMP_Text.firstVisibleCharacter
    TMP_Text.m_firstVisibleCharacter
    TMP_Text.maxVisibleCharacters
    TMP_Text.m_maxVisibleCharacters
    TMP_Text.maxVisibleWords
    TMP_Text.m_maxVisibleWords
    TMP_Text.maxVisibleLines
    TMP_Text.m_maxVisibleLines
    TMP_Text.useMaxVisibleDescender
    TMP_Text.m_useMaxVisibleDescender
    TMP_Text.pageToDisplay
    TMP_Text.m_pageToDisplay
    TMP_Text.m_isNewPage
    TMP_Text.margin
    TMP_Text.m_margin
    TMP_Text.m_marginLeft
    TMP_Text.m_marginRight
    TMP_Text.m_marginWidth
    TMP_Text.m_marginHeight
    TMP_Text.m_width
    TMP_Text.textInfo
    TMP_Text.m_textInfo
    TMP_Text.havePropertiesChanged
    TMP_Text.m_havePropertiesChanged
    TMP_Text.isUsingLegacyAnimationComponent
    TMP_Text.m_isUsingLegacyAnimationComponent
    TMP_Text.transform
    TMP_Text.m_transform
    TMP_Text.rectTransform
    TMP_Text.m_rectTransform
    TMP_Text.m_autoSizeTextContainer
    TMP_Text.m_mesh
    TMP_Text.isVolumetricText
    TMP_Text.m_isVolumetricText
    TMP_Text.bounds
    TMP_Text.textBounds
    TMP_Text.spriteAnimator
    TMP_Text.m_spriteAnimator
    TMP_Text.flexibleHeight
    TMP_Text.m_flexibleHeight
    TMP_Text.flexibleWidth
    TMP_Text.m_flexibleWidth
    TMP_Text.minWidth
    TMP_Text.m_minWidth
    TMP_Text.minHeight
    TMP_Text.m_minHeight
    TMP_Text.maxWidth
    TMP_Text.m_maxWidth
    TMP_Text.maxHeight
    TMP_Text.m_maxHeight
    TMP_Text.layoutElement
    TMP_Text.m_LayoutElement
    TMP_Text.preferredWidth
    TMP_Text.m_preferredWidth
    TMP_Text.m_renderedWidth
    TMP_Text.m_isPreferredWidthDirty
    TMP_Text.preferredHeight
    TMP_Text.m_preferredHeight
    TMP_Text.m_renderedHeight
    TMP_Text.m_isPreferredHeightDirty
    TMP_Text.m_isCalculatingPreferredValues
    TMP_Text.renderedWidth
    TMP_Text.renderedHeight
    TMP_Text.layoutPriority
    TMP_Text.m_layoutPriority
    TMP_Text.m_isCalculateSizeRequired
    TMP_Text.m_isLayoutDirty
    TMP_Text.m_verticesAlreadyDirty
    TMP_Text.m_layoutAlreadyDirty
    TMP_Text.m_isAwake
    TMP_Text.m_isWaitingOnResourceLoad
    TMP_Text.m_isInputParsingRequired
    TMP_Text.m_inputSource
    TMP_Text.old_text
    TMP_Text.m_fontScale
    TMP_Text.m_fontScaleMultiplier
    TMP_Text.m_htmlTag
    TMP_Text.m_xmlAttribute
    TMP_Text.m_attributeParameterValues
    TMP_Text.tag_LineIndent
    TMP_Text.tag_Indent
    TMP_Text.m_indentStack
    TMP_Text.tag_NoParsing
    TMP_Text.m_isParsingText
    TMP_Text.m_FXMatrix
    TMP_Text.m_isFXMatrixSet
    TMP_Text.m_char_buffer
    TMP_Text.m_input_CharArray
    TMP_Text.m_totalCharacterCount
    TMP_Text.m_SavedWordWrapState
    TMP_Text.m_SavedLineState
    TMP_Text.m_characterCount
    TMP_Text.m_firstCharacterOfLine
    TMP_Text.m_firstVisibleCharacterOfLine
    TMP_Text.m_lastCharacterOfLine
    TMP_Text.m_lastVisibleCharacterOfLine
    TMP_Text.m_lineNumber
    TMP_Text.m_lineVisibleCharacterCount
    TMP_Text.m_pageNumber
    TMP_Text.m_maxAscender
    TMP_Text.m_maxCapHeight
    TMP_Text.m_maxDescender
    TMP_Text.m_maxLineAscender
    TMP_Text.m_maxLineDescender
    TMP_Text.m_startOfLineAscender
    TMP_Text.m_lineOffset
    TMP_Text.m_meshExtents
    TMP_Text.m_htmlColor
    TMP_Text.m_colorStack
    TMP_Text.m_underlineColorStack
    TMP_Text.m_strikethroughColorStack
    TMP_Text.m_highlightColorStack
    TMP_Text.m_colorGradientPreset
    TMP_Text.m_colorGradientStack
    TMP_Text.m_tabSpacing
    TMP_Text.m_spacing
    TMP_Text.m_styleStack
    TMP_Text.m_actionStack
    TMP_Text.m_padding
    TMP_Text.m_baselineOffset
    TMP_Text.m_baselineOffsetStack
    TMP_Text.m_xAdvance
    TMP_Text.m_textElementType
    TMP_Text.m_cached_TextElement
    TMP_Text.m_cached_Underline_GlyphInfo
    TMP_Text.m_cached_Ellipsis_GlyphInfo
    TMP_Text.m_defaultSpriteAsset
    TMP_Text.m_currentSpriteAsset
    TMP_Text.m_spriteCount
    TMP_Text.m_spriteIndex
    TMP_Text.m_spriteAnimationID
    TMP_Text.SetFontBaseMaterial(Material)
    TMP_Text.CreateMaterialInstance(Material)
    TMP_Text.SetVertexColorGradient(TMP_ColorGradient)
    TMP_Text.SetTextSortingOrder(VertexSortingOrder)
    TMP_Text.SetTextSortingOrder(Int32[])
    TMP_Text.m_ignoreActiveState
    TMP_Text.SetVertices(Vector3[])
    TMP_Text.CrossFadeColor(Color, Single, Boolean, Boolean)
    TMP_Text.CrossFadeAlpha(Single, Single, Boolean)
    TMP_Text.ParseInputText()
    TMP_Text.SetText(String)
    TMP_Text.SetText(String, Boolean)
    TMP_Text.SetText(String, Single)
    TMP_Text.SetText(String, Single, Single)
    TMP_Text.SetText(String, Single, Single, Single)
    TMP_Text.SetText(StringBuilder)
    TMP_Text.SetCharArray(Char[])
    TMP_Text.SetCharArray(Char[], Int32, Int32)
    TMP_Text.SetCharArray(Int32[], Int32, Int32)
    TMP_Text.SetTextArrayToCharArray(Char[], Int32[])
    TMP_Text.StringToCharArray(String, Int32[])
    TMP_Text.StringBuilderToIntArray(StringBuilder, Int32[])
    TMP_Text.AddFloatToCharArray(Single, Int32, Int32)
    TMP_Text.AddIntToCharArray(Int32, Int32, Int32)
    TMP_Text.GetPreferredValues()
    TMP_Text.GetPreferredValues(Single, Single)
    TMP_Text.GetPreferredValues(String)
    TMP_Text.GetPreferredValues(String, Single, Single)
    TMP_Text.GetPreferredWidth()
    TMP_Text.GetPreferredWidth(Vector2)
    TMP_Text.GetPreferredHeight()
    TMP_Text.GetPreferredHeight(Vector2)
    TMP_Text.GetRenderedValues()
    TMP_Text.GetRenderedValues(Boolean)
    TMP_Text.GetRenderedWidth()
    TMP_Text.GetRenderedWidth(Boolean)
    TMP_Text.GetRenderedHeight()
    TMP_Text.GetRenderedHeight(Boolean)
    TMP_Text.CalculatePreferredValues(Single, Vector2, Boolean)
    TMP_Text.GetTextBounds()
    TMP_Text.GetTextBounds(Boolean)
    TMP_Text.ResizeLineExtents(Int32)
    TMP_Text.k_LargePositiveVector2
    TMP_Text.k_LargeNegativeVector2
    TMP_Text.k_LargePositiveFloat
    TMP_Text.k_LargeNegativeFloat
    TMP_Text.k_LargePositiveInt
    TMP_Text.k_LargeNegativeInt
    TMP_Text.SaveWordWrappingState(WordWrapState, Int32, Int32)
    TMP_Text.RestoreWordWrappingState(WordWrapState)
    TMP_Text.SaveGlyphVertexInfo(Single, Single, Color32)
    TMP_Text.SaveSpriteVertexInfo(Color32)
    TMP_Text.FillCharacterVertexBuffers(Int32, Int32)
    TMP_Text.FillCharacterVertexBuffers(Int32, Int32, Boolean)
    TMP_Text.FillSpriteVertexBuffers(Int32, Int32)
    TMP_Text.DrawUnderlineMesh(Vector3, Vector3, Int32, Single, Single, Single, Single, Color32)
    TMP_Text.DrawTextHighlight(Vector3, Vector3, Int32, Color32)
    TMP_Text.LoadDefaultSettings()
    TMP_Text.GetSpecialCharacters(TMP_FontAsset)
    TMP_Text.ReplaceTagWithCharacter(Int32[], Int32, Int32, Char)
    TMP_Text.GetFontAssetForWeight(Int32)
    TMP_Text.ClearSubMeshObjects()
    TMP_Text.ClearMesh(Boolean)
    TMP_Text.GetParsedText()
    TMP_Text.PackUV(Single, Single, Single)
    TMP_Text.PackUV(Single, Single)
    TMP_Text.HexToInt(Char)
    TMP_Text.GetUTF16(Int32)
    TMP_Text.GetUTF32(Int32)
    TMP_Text.HexCharsToColor(Char[], Int32)
    TMP_Text.HexCharsToColor(Char[], Int32, Int32)
    TMP_Text.ConvertToFloat(Char[], Int32, Int32)
    TMP_Text.ConvertToFloat(Char[], Int32, Int32, Int32)
    TMP_Text.ValidateHtmlTag(Int32[], Int32, Int32)
    UnityEngine.UI.MaskableGraphic.m_ShouldRecalculateStencil
    UnityEngine.UI.MaskableGraphic.m_MaskMaterial
    UnityEngine.UI.MaskableGraphic.m_StencilValue
    UnityEngine.UI.MaskableGraphic.SetClipRect(UnityEngine.Rect, System.Boolean)
    UnityEngine.UI.MaskableGraphic.SetClipSoftness(UnityEngine.Vector2)
    UnityEngine.UI.MaskableGraphic.OnValidate()
    UnityEngine.UI.MaskableGraphic.UnityEngine.UI.IClippable.get_gameObject()
    UnityEngine.UI.MaskableGraphic.onCullStateChanged
    UnityEngine.UI.MaskableGraphic.maskable
    UnityEngine.UI.MaskableGraphic.isMaskingGraphic
    UnityEngine.UI.Graphic.s_DefaultUI
    UnityEngine.UI.Graphic.s_WhiteTexture
    UnityEngine.UI.Graphic.m_Material
    UnityEngine.UI.Graphic.m_SkipLayoutUpdate
    UnityEngine.UI.Graphic.m_SkipMaterialUpdate
    UnityEngine.UI.Graphic.m_OnDirtyLayoutCallback
    UnityEngine.UI.Graphic.m_OnDirtyVertsCallback
    UnityEngine.UI.Graphic.m_OnDirtyMaterialCallback
    UnityEngine.UI.Graphic.s_Mesh
    UnityEngine.UI.Graphic.m_CachedMesh
    UnityEngine.UI.Graphic.m_CachedUvs
    UnityEngine.UI.Graphic.SetRaycastDirty()
    UnityEngine.UI.Graphic.OnBeforeTransformParentChanged()
    UnityEngine.UI.Graphic.OnCullingChanged()
    UnityEngine.UI.Graphic.LayoutComplete()
    UnityEngine.UI.Graphic.GraphicUpdateComplete()
    UnityEngine.UI.Graphic.UpdateGeometry()
    UnityEngine.UI.Graphic.OnPopulateMesh(UnityEngine.Mesh)
    UnityEngine.UI.Graphic.OnPopulateMesh(UnityEngine.UI.VertexHelper)
    UnityEngine.UI.Graphic.OnRebuildRequested()
    UnityEngine.UI.Graphic.Reset()
    UnityEngine.UI.Graphic.SetNativeSize()
    UnityEngine.UI.Graphic.Raycast(UnityEngine.Vector2, UnityEngine.Camera)
    UnityEngine.UI.Graphic.PixelAdjustPoint(UnityEngine.Vector2)
    UnityEngine.UI.Graphic.GetPixelAdjustedRect()
    UnityEngine.UI.Graphic.CrossFadeColor(UnityEngine.Color, System.Single, System.Boolean, System.Boolean, System.Boolean)
    UnityEngine.UI.Graphic.RegisterDirtyLayoutCallback(UnityEngine.Events.UnityAction)
    UnityEngine.UI.Graphic.UnregisterDirtyLayoutCallback(UnityEngine.Events.UnityAction)
    UnityEngine.UI.Graphic.RegisterDirtyVerticesCallback(UnityEngine.Events.UnityAction)
    UnityEngine.UI.Graphic.UnregisterDirtyVerticesCallback(UnityEngine.Events.UnityAction)
    UnityEngine.UI.Graphic.RegisterDirtyMaterialCallback(UnityEngine.Events.UnityAction)
    UnityEngine.UI.Graphic.UnregisterDirtyMaterialCallback(UnityEngine.Events.UnityAction)
    UnityEngine.UI.Graphic.UnityEngine.UI.ICanvasElement.get_transform()
    UnityEngine.UI.Graphic.defaultGraphicMaterial
    UnityEngine.UI.Graphic.raycastTarget
    UnityEngine.UI.Graphic.raycastPadding
    UnityEngine.UI.Graphic.useLegacyMeshGeneration
    UnityEngine.UI.Graphic.depth
    UnityEngine.UI.Graphic.canvas
    UnityEngine.UI.Graphic.defaultMaterial
    UnityEngine.UI.Graphic.material
    UnityEngine.UI.Graphic.mainTexture
    UnityEngine.UI.Graphic.workerMesh
    UnityEngine.EventSystems.UIBehaviour.Start()
    UnityEngine.EventSystems.UIBehaviour.IsActive()
    UnityEngine.EventSystems.UIBehaviour.OnCanvasGroupChanged()
    UnityEngine.EventSystems.UIBehaviour.IsDestroyed()
    Namespace: TMPro
    Syntax
    [ExecuteInEditMode]
    [DisallowMultipleComponent]
    [RequireComponent(typeof(RectTransform))]
    [RequireComponent(typeof(CanvasRenderer))]
    [AddComponentMenu("UI/TextMeshPro - Text (UI)", 11)]
    public class TextMeshProUGUI : TMP_Text, ICanvasElement, IClippable, IMaskable, IMaterialModifier, ILayoutElement

    Fields

    m_subTextObjects

    Declaration
    [SerializeField]
    protected TMP_SubMeshUI[] m_subTextObjects
    Field Value
    Type Description
    TMP_SubMeshUI[]

    Properties

    autoSizeTextContainer

    Determines if the size of the text container will be adjusted to fit the text object when it is first created.

    Declaration
    public override bool autoSizeTextContainer { get; set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    TMP_Text.autoSizeTextContainer

    canvasRenderer

    Reference to the CanvasRenderer used by the text object.

    Declaration
    public CanvasRenderer canvasRenderer { get; }
    Property Value
    Type Description
    CanvasRenderer

    maskOffset

    Sets the masking offset from the bounds of the object

    Declaration
    public Vector4 maskOffset { get; set; }
    Property Value
    Type Description
    Vector4

    materialForRendering

    Get the material that will be used for rendering.

    Declaration
    public override Material materialForRendering { get; }
    Property Value
    Type Description
    Material
    Overrides
    UnityEngine.UI.Graphic.materialForRendering

    mesh

    Reference to the Mesh used by the text object.

    Declaration
    public override Mesh mesh { get; }
    Property Value
    Type Description
    Mesh
    Overrides
    TMP_Text.mesh

    Methods

    AdjustLineOffset(Int32, Int32, Single)

    Declaration
    protected override void AdjustLineOffset(int startIndex, int endIndex, float offset)
    Parameters
    Type Name Description
    System.Int32 startIndex
    System.Int32 endIndex
    System.Single offset
    Overrides
    TMP_Text.AdjustLineOffset(Int32, Int32, Single)

    Awake()

    Declaration
    protected override void Awake()
    Overrides
    UnityEngine.EventSystems.UIBehaviour.Awake()

    CalculateLayoutInputHorizontal()

    Function called by Unity when the horizontal layout needs to be recalculated.

    Declaration
    public void CalculateLayoutInputHorizontal()
    Implements
    UnityEngine.UI.ILayoutElement.CalculateLayoutInputHorizontal()

    CalculateLayoutInputVertical()

    Function called by Unity when the vertical layout needs to be recalculated.

    Declaration
    public void CalculateLayoutInputVertical()
    Implements
    UnityEngine.UI.ILayoutElement.CalculateLayoutInputVertical()

    ClearMesh()

    Function to clear the geometry of the Primary and Sub Text objects.

    Declaration
    public override void ClearMesh()
    Overrides
    TMP_Text.ClearMesh()

    ComputeMarginSize()

    Update the margin width and height

    Declaration
    protected override void ComputeMarginSize()
    Overrides
    TMP_Text.ComputeMarginSize()

    Cull(Rect, Boolean)

    Override of the Cull function to provide for the ability to override the culling of the text object.

    Declaration
    public override void Cull(Rect clipRect, bool validRect)
    Parameters
    Type Name Description
    Rect clipRect
    System.Boolean validRect

    ForceMeshUpdate()

    Function to force regeneration of the mesh before its normal process time. This is useful when changes to the text object properties need to be applied immediately.

    Declaration
    public override void ForceMeshUpdate()
    Overrides
    TMP_Text.ForceMeshUpdate()

    ForceMeshUpdate(Boolean)

    Function to force regeneration of the mesh before its normal process time. This is useful when changes to the text object properties need to be applied immediately.

    Declaration
    public override void ForceMeshUpdate(bool ignoreInactive)
    Parameters
    Type Name Description
    System.Boolean ignoreInactive

    If set to true, the text object will be regenerated regardless of is active state.

    Overrides
    TMP_Text.ForceMeshUpdate(Boolean)

    GenerateTextMesh()

    This is the main function that is responsible for creating / displaying the text.

    Declaration
    protected override void GenerateTextMesh()
    Overrides
    TMP_Text.GenerateTextMesh()

    GetCompoundBounds()

    Method returning the compound bounds of the text object and child sub objects.

    Declaration
    protected override Bounds GetCompoundBounds()
    Returns
    Type Description
    Bounds
    Overrides
    TMP_Text.GetCompoundBounds()

    GetMaterial(Material)

    Declaration
    protected override Material GetMaterial(Material mat)
    Parameters
    Type Name Description
    Material mat
    Returns
    Type Description
    Material
    Overrides
    TMP_Text.GetMaterial(Material)

    GetMaterials(Material[])

    Method returning instances of the materials used by the text object.

    Declaration
    protected override Material[] GetMaterials(Material[] mats)
    Parameters
    Type Name Description
    Material[] mats
    Returns
    Type Description
    Material[]
    Overrides
    TMP_Text.GetMaterials(Material[])

    GetModifiedMaterial(Material)

    Declaration
    public override Material GetModifiedMaterial(Material baseMaterial)
    Parameters
    Type Name Description
    Material baseMaterial
    Returns
    Type Description
    Material

    GetPaddingForMaterial()

    Get the padding value for the currently assigned material.

    Declaration
    protected override float GetPaddingForMaterial()
    Returns
    Type Description
    System.Single
    Overrides
    TMP_Text.GetPaddingForMaterial()

    GetPaddingForMaterial(Material)

    Get the padding value for the currently assigned material.

    Declaration
    protected override float GetPaddingForMaterial(Material mat)
    Parameters
    Type Name Description
    Material mat
    Returns
    Type Description
    System.Single
    Overrides
    TMP_Text.GetPaddingForMaterial(Material)

    GetSharedMaterials()

    Method returning an array containing the materials used by the text object.

    Declaration
    protected override Material[] GetSharedMaterials()
    Returns
    Type Description
    Material[]
    Overrides
    TMP_Text.GetSharedMaterials()

    GetTextContainerLocalCorners()

    Method to return the local corners of the Text Container or RectTransform.

    Declaration
    protected override Vector3[] GetTextContainerLocalCorners()
    Returns
    Type Description
    Vector3[]
    Overrides
    TMP_Text.GetTextContainerLocalCorners()

    GetTextInfo(String)

    Function used to evaluate the length of a text string.

    Declaration
    public override TMP_TextInfo GetTextInfo(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    TMP_TextInfo
    Overrides
    TMP_Text.GetTextInfo(String)

    InternalCrossFadeAlpha(Single, Single, Boolean)

    Tweens the alpha of the CanvasRenderer color associated with this Graphic.

    Declaration
    protected override void InternalCrossFadeAlpha(float alpha, float duration, bool ignoreTimeScale)
    Parameters
    Type Name Description
    System.Single alpha

    Target alpha.

    System.Single duration

    Duration of the tween in seconds.

    System.Boolean ignoreTimeScale

    Should ignore Time.scale?

    Overrides
    TMP_Text.InternalCrossFadeAlpha(Single, Single, Boolean)

    InternalCrossFadeColor(Color, Single, Boolean, Boolean)

    Tweens the CanvasRenderer color associated with this Graphic.

    Declaration
    protected override void InternalCrossFadeColor(Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
    Parameters
    Type Name Description
    Color targetColor

    Target color.

    System.Single duration

    Tween duration.

    System.Boolean ignoreTimeScale

    Should ignore Time.scale?

    System.Boolean useAlpha

    Should also Tween the alpha channel?

    Overrides
    TMP_Text.InternalCrossFadeColor(Color, Single, Boolean, Boolean)

    LoadFontAsset()

    Declaration
    protected override void LoadFontAsset()
    Overrides
    TMP_Text.LoadFontAsset()

    OnCanvasHierarchyChanged()

    Declaration
    protected override void OnCanvasHierarchyChanged()
    Overrides
    UnityEngine.UI.MaskableGraphic.OnCanvasHierarchyChanged()

    OnDestroy()

    Declaration
    protected override void OnDestroy()
    Overrides
    UnityEngine.UI.Graphic.OnDestroy()

    OnDidApplyAnimationProperties()

    Declaration
    protected override void OnDidApplyAnimationProperties()
    Overrides
    UnityEngine.UI.Graphic.OnDidApplyAnimationProperties()

    OnDisable()

    Declaration
    protected override void OnDisable()
    Overrides
    UnityEngine.UI.MaskableGraphic.OnDisable()

    OnEnable()

    Declaration
    protected override void OnEnable()
    Overrides
    UnityEngine.UI.MaskableGraphic.OnEnable()

    OnRectTransformDimensionsChange()

    Declaration
    protected override void OnRectTransformDimensionsChange()
    Overrides
    UnityEngine.UI.Graphic.OnRectTransformDimensionsChange()

    OnTransformParentChanged()

    Declaration
    protected override void OnTransformParentChanged()
    Overrides
    UnityEngine.UI.MaskableGraphic.OnTransformParentChanged()

    Rebuild(CanvasUpdate)

    Declaration
    public override void Rebuild(CanvasUpdate update)
    Parameters
    Type Name Description
    UnityEngine.UI.CanvasUpdate update
    Overrides
    UnityEngine.UI.Graphic.Rebuild(UnityEngine.UI.CanvasUpdate)

    RecalculateClipping()

    Method called when the state of a parent changes.

    Declaration
    public override void RecalculateClipping()
    Overrides
    UnityEngine.UI.MaskableGraphic.RecalculateClipping()

    RecalculateMasking()

    Method called when Stencil Mask needs to be updated on this element and parents.

    Declaration
    public override void RecalculateMasking()
    Overrides
    UnityEngine.UI.MaskableGraphic.RecalculateMasking()

    SetActiveSubMeshes(Boolean)

    Method to Enable or Disable child SubMesh objects.

    Declaration
    protected override void SetActiveSubMeshes(bool state)
    Parameters
    Type Name Description
    System.Boolean state
    Overrides
    TMP_Text.SetActiveSubMeshes(Boolean)

    SetAllDirty()

    Declaration
    public override void SetAllDirty()
    Overrides
    UnityEngine.UI.Graphic.SetAllDirty()

    SetArraySizes(Int32[])

    Declaration
    protected override int SetArraySizes(int[] chars)
    Parameters
    Type Name Description
    System.Int32[] chars
    Returns
    Type Description
    System.Int32
    Overrides
    TMP_Text.SetArraySizes(Int32[])

    SetCulling()

    Declaration
    protected override void SetCulling()
    Overrides
    TMP_Text.SetCulling()

    SetFaceColor(Color32)

    Declaration
    protected override void SetFaceColor(Color32 color)
    Parameters
    Type Name Description
    Color32 color
    Overrides
    TMP_Text.SetFaceColor(Color32)

    SetLayoutDirty()

    Declaration
    public override void SetLayoutDirty()
    Overrides
    UnityEngine.UI.Graphic.SetLayoutDirty()

    SetMaterialDirty()

    Declaration
    public override void SetMaterialDirty()
    Overrides
    UnityEngine.UI.Graphic.SetMaterialDirty()

    SetOutlineColor(Color32)

    Declaration
    protected override void SetOutlineColor(Color32 color)
    Parameters
    Type Name Description
    Color32 color
    Overrides
    TMP_Text.SetOutlineColor(Color32)

    SetOutlineThickness(Single)

    Declaration
    protected override void SetOutlineThickness(float thickness)
    Parameters
    Type Name Description
    System.Single thickness
    Overrides
    TMP_Text.SetOutlineThickness(Single)

    SetShaderDepth()

    Declaration
    protected override void SetShaderDepth()
    Overrides
    TMP_Text.SetShaderDepth()

    SetSharedMaterial(Material)

    Declaration
    protected override void SetSharedMaterial(Material mat)
    Parameters
    Type Name Description
    Material mat
    Overrides
    TMP_Text.SetSharedMaterial(Material)

    SetSharedMaterials(Material[])

    Method used to assign new materials to the text and sub text objects.

    Declaration
    protected override void SetSharedMaterials(Material[] materials)
    Parameters
    Type Name Description
    Material[] materials
    Overrides
    TMP_Text.SetSharedMaterials(Material[])

    SetVerticesDirty()

    Declaration
    public override void SetVerticesDirty()
    Overrides
    UnityEngine.UI.Graphic.SetVerticesDirty()

    UpdateFontAsset()

    Declaration
    public void UpdateFontAsset()

    UpdateGeometry(Mesh, Int32)

    Function to update the geometry of the main and sub text objects.

    Declaration
    public override void UpdateGeometry(Mesh mesh, int index)
    Parameters
    Type Name Description
    Mesh mesh
    System.Int32 index
    Overrides
    TMP_Text.UpdateGeometry(Mesh, Int32)

    UpdateMaterial()

    Declaration
    protected override void UpdateMaterial()
    Overrides
    UnityEngine.UI.Graphic.UpdateMaterial()

    UpdateMeshPadding()

    Function to be used to force recomputing of character padding when Shader / Material properties have been changed via script.

    Declaration
    public override void UpdateMeshPadding()
    Overrides
    TMP_Text.UpdateMeshPadding()

    UpdateVertexData()

    Function to upload the updated vertex data and renderer.

    Declaration
    public override void UpdateVertexData()
    Overrides
    TMP_Text.UpdateVertexData()

    UpdateVertexData(TMP_VertexDataUpdateFlags)

    Function to upload the updated vertex data and renderer.

    Declaration
    public override void UpdateVertexData(TMP_VertexDataUpdateFlags flags)
    Parameters
    Type Name Description
    TMP_VertexDataUpdateFlags flags
    Overrides
    TMP_Text.UpdateVertexData(TMP_VertexDataUpdateFlags)
    In This Article
    • Fields
      • m_subTextObjects
    • Properties
      • autoSizeTextContainer
      • canvasRenderer
      • maskOffset
      • materialForRendering
      • mesh
    • Methods
      • AdjustLineOffset(Int32, Int32, Single)
      • Awake()
      • CalculateLayoutInputHorizontal()
      • CalculateLayoutInputVertical()
      • ClearMesh()
      • ComputeMarginSize()
      • Cull(Rect, Boolean)
      • ForceMeshUpdate()
      • ForceMeshUpdate(Boolean)
      • GenerateTextMesh()
      • GetCompoundBounds()
      • GetMaterial(Material)
      • GetMaterials(Material[])
      • GetModifiedMaterial(Material)
      • GetPaddingForMaterial()
      • GetPaddingForMaterial(Material)
      • GetSharedMaterials()
      • GetTextContainerLocalCorners()
      • GetTextInfo(String)
      • InternalCrossFadeAlpha(Single, Single, Boolean)
      • InternalCrossFadeColor(Color, Single, Boolean, Boolean)
      • LoadFontAsset()
      • OnCanvasHierarchyChanged()
      • OnDestroy()
      • OnDidApplyAnimationProperties()
      • OnDisable()
      • OnEnable()
      • OnRectTransformDimensionsChange()
      • OnTransformParentChanged()
      • Rebuild(CanvasUpdate)
      • RecalculateClipping()
      • RecalculateMasking()
      • SetActiveSubMeshes(Boolean)
      • SetAllDirty()
      • SetArraySizes(Int32[])
      • SetCulling()
      • SetFaceColor(Color32)
      • SetLayoutDirty()
      • SetMaterialDirty()
      • SetOutlineColor(Color32)
      • SetOutlineThickness(Single)
      • SetShaderDepth()
      • SetSharedMaterial(Material)
      • SetSharedMaterials(Material[])
      • SetVerticesDirty()
      • UpdateFontAsset()
      • UpdateGeometry(Mesh, Int32)
      • UpdateMaterial()
      • UpdateMeshPadding()
      • UpdateVertexData()
      • UpdateVertexData(TMP_VertexDataUpdateFlags)
    Back to top
    Copyright © 2025 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 02 April 2025