docs.unity3d.com
    Show / Hide Table of Contents

    Class TextMeshPro

    Inheritance
    Object
    UIBehaviour
    Graphic
    MaskableGraphic
    TMP_Text
    TextMeshPro
    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.m_highlightPadding
    TMP_Text.alpha
    TMP_Text.enableVertexGradient
    TMP_Text.m_enableVertexGradient
    TMP_Text.m_colorMode
    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_FontStyleInternal
    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.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.vertexBufferAutoSizeReduction
    TMP_Text.m_VertexBufferAutoSizeReduction
    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.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.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_TextParsingBuffer
    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_Character
    TMP_Text.m_cached_Ellipsis_Character
    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.InternalCrossFadeColor(Color, Single, Boolean, Boolean)
    TMP_Text.InternalCrossFadeAlpha(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[], TMP_Text.UnicodeChar[])
    TMP_Text.StringToCharArray(String, TMP_Text.UnicodeChar[])
    TMP_Text.StringBuilderToIntArray(StringBuilder, TMP_Text.UnicodeChar[])
    TMP_Text.AddFloatToCharArray(Double, Int32, Int32)
    TMP_Text.AddIntToCharArray(Double, 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.ClearMesh()
    TMP_Text.GetParsedText()
    TMP_Text.PackUV(Single, Single, Single)
    TMP_Text.PackUV(Single, Single)
    TMP_Text.HexToInt(Char)
    TMP_Text.GetUTF16(String, Int32)
    TMP_Text.GetUTF16(StringBuilder, Int32)
    TMP_Text.GetUTF32(String, Int32)
    TMP_Text.GetUTF32(StringBuilder, 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(TMP_Text.UnicodeChar[], Int32, Int32)
    MaskableGraphic.m_ShouldRecalculateStencil
    MaskableGraphic.m_MaskMaterial
    MaskableGraphic.m_IncludeForMasking
    MaskableGraphic.m_ShouldRecalculate
    MaskableGraphic.m_StencilValue
    MaskableGraphic.GetModifiedMaterial(Material)
    MaskableGraphic.Cull(Rect, Boolean)
    MaskableGraphic.SetClipRect(Rect, Boolean)
    UnityEngine.UI.MaskableGraphic.OnValidate()
    MaskableGraphic.ParentMaskStateChanged()
    MaskableGraphic.OnCanvasHierarchyChanged()
    MaskableGraphic.RecalculateClipping()
    MaskableGraphic.RecalculateMasking()
    UnityEngine.UI.MaskableGraphic.UnityEngine.UI.IClippable.get_gameObject()
    MaskableGraphic.onCullStateChanged
    MaskableGraphic.maskable
    MaskableGraphic.isMaskingGraphic
    Graphic.s_DefaultUI
    Graphic.s_WhiteTexture
    Graphic.m_Material
    Graphic.m_SkipLayoutUpdate
    Graphic.m_SkipMaterialUpdate
    Graphic.m_OnDirtyLayoutCallback
    Graphic.m_OnDirtyVertsCallback
    Graphic.m_OnDirtyMaterialCallback
    Graphic.s_Mesh
    Graphic.m_CachedMesh
    Graphic.m_CachedUvs
    Graphic.OnBeforeTransformParentChanged()
    Graphic.OnCullingChanged()
    Graphic.LayoutComplete()
    Graphic.GraphicUpdateComplete()
    Graphic.UpdateGeometry()
    Graphic.OnFillVBO(List<UIVertex>)
    Graphic.OnPopulateMesh(Mesh)
    Graphic.OnPopulateMesh(VertexHelper)
    UnityEngine.UI.Graphic.OnRebuildRequested()
    UnityEngine.UI.Graphic.Reset()
    Graphic.SetNativeSize()
    Graphic.Raycast(Vector2, Camera)
    Graphic.PixelAdjustPoint(Vector2)
    Graphic.GetPixelAdjustedRect()
    Graphic.CrossFadeColor(Color, Single, Boolean, Boolean, Boolean)
    Graphic.RegisterDirtyLayoutCallback(UnityAction)
    Graphic.UnregisterDirtyLayoutCallback(UnityAction)
    Graphic.RegisterDirtyVerticesCallback(UnityAction)
    Graphic.UnregisterDirtyVerticesCallback(UnityAction)
    Graphic.RegisterDirtyMaterialCallback(UnityAction)
    Graphic.UnregisterDirtyMaterialCallback(UnityAction)
    UnityEngine.UI.Graphic.UnityEngine.UI.ICanvasElement.get_transform()
    Graphic.defaultGraphicMaterial
    Graphic.raycastTarget
    Graphic.useLegacyMeshGeneration
    Graphic.depth
    Graphic.canvas
    Graphic.canvasRenderer
    Graphic.defaultMaterial
    Graphic.material
    Graphic.materialForRendering
    Graphic.mainTexture
    Graphic.workerMesh
    UIBehaviour.Start()
    UIBehaviour.IsActive()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.IsDestroyed()
    Namespace: TMPro
    Syntax
    [DisallowMultipleComponent]
    [RequireComponent(typeof(MeshRenderer))]
    [RequireComponent(typeof(MeshFilter))]
    [AddComponentMenu("Mesh/TextMeshPro - Text")]
    [ExecuteAlways]
    public class TextMeshPro : TMP_Text, ICanvasElement, IClippable, IMaskable, IMaterialModifier, ILayoutElement

    Fields

    m_subTextObjects

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

    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
    Boolean
    Overrides
    TMP_Text.autoSizeTextContainer

    maskType

    Sets the mask type

    Declaration
    public MaskingTypes maskType { get; set; }
    Property Value
    Type Description
    MaskingTypes

    mesh

    Returns the mesh assigned to the text object.

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

    meshFilter

    Returns the Mesh Filter of the text object.

    Declaration
    public MeshFilter meshFilter { get; }
    Property Value
    Type Description
    MeshFilter

    renderer

    Returns the rendered assigned to the text object.

    Declaration
    public Renderer renderer { get; }
    Property Value
    Type Description
    Renderer

    sortingLayerID

    Sets the Renderer's sorting Layer ID

    Declaration
    public int sortingLayerID { get; set; }
    Property Value
    Type Description
    Int32

    sortingOrder

    Sets the Renderer's sorting order within the assigned layer.

    Declaration
    public int sortingOrder { get; set; }
    Property Value
    Type Description
    Int32

    textContainer

    Returns a reference to the Text Container

    Declaration
    [Obsolete("The TextContainer is now obsolete. Use the RectTransform instead.")]
    public TextContainer textContainer { get; }
    Property Value
    Type Description
    TextContainer

    transform

    Returns a reference to the Transform

    Declaration
    public Transform transform { get; }
    Property Value
    Type Description
    Transform

    Methods

    AdjustLineOffset(Int32, Int32, Single)

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

    Awake()

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

    CalculateLayoutInputHorizontal()

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

    CalculateLayoutInputVertical()

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

    ClearMesh(Boolean)

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

    Declaration
    public override void ClearMesh(bool updateMesh)
    Parameters
    Type Name Description
    Boolean updateMesh
    Overrides
    TMP_Text.ClearMesh(Boolean)

    ClearSubMeshObjects()

    Destroy Sub Mesh Objects

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

    ComputeMarginSize()

    Update the margin width and height

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

    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
    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[])

    GetPaddingForMaterial()

    Get the padding value for the currently assigned material.

    Declaration
    protected override float GetPaddingForMaterial()
    Returns
    Type Description
    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
    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
    String text
    Returns
    Type Description
    TMP_TextInfo
    Overrides
    TMP_Text.GetTextInfo(String)

    LoadFontAsset()

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

    OnDestroy()

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

    OnDidApplyAnimationProperties()

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

    OnDisable()

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

    OnEnable()

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

    OnRectTransformDimensionsChange()

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

    OnTransformParentChanged()

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

    Rebuild(CanvasUpdate)

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

    SetActiveSubMeshes(Boolean)

    Method to Enable or Disable child SubMesh objects.

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

    SetAllDirty()

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

    SetArraySizes(TMP_Text.UnicodeChar[])

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

    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
    Graphic.SetLayoutDirty()

    SetMask(MaskingTypes, Vector4)

    Function used to set the mask type and coordinates in World Space

    Declaration
    public void SetMask(MaskingTypes type, Vector4 maskCoords)
    Parameters
    Type Name Description
    MaskingTypes type
    Vector4 maskCoords

    SetMask(MaskingTypes, Vector4, Single, Single)

    Function used to set the mask type, coordinates and softness

    Declaration
    public void SetMask(MaskingTypes type, Vector4 maskCoords, float softnessX, float softnessY)
    Parameters
    Type Name Description
    MaskingTypes type
    Vector4 maskCoords
    Single softnessX
    Single softnessY

    SetMaterialDirty()

    Schedule updating of the material used by the text object.

    Declaration
    public override void SetMaterialDirty()
    Overrides
    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
    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()

    Schedule rebuilding of the text geometry.

    Declaration
    public override void SetVerticesDirty()
    Overrides
    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
    Int32 index
    Overrides
    TMP_Text.UpdateGeometry(Mesh, Int32)

    UpdateMaterial()

    Declaration
    protected override void UpdateMaterial()
    Overrides
    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
      • maskType
      • mesh
      • meshFilter
      • renderer
      • sortingLayerID
      • sortingOrder
      • textContainer
      • transform
    • Methods
      • AdjustLineOffset(Int32, Int32, Single)
      • Awake()
      • CalculateLayoutInputHorizontal()
      • CalculateLayoutInputVertical()
      • ClearMesh(Boolean)
      • ClearSubMeshObjects()
      • ComputeMarginSize()
      • ForceMeshUpdate()
      • ForceMeshUpdate(Boolean)
      • GenerateTextMesh()
      • GetCompoundBounds()
      • GetMaterial(Material)
      • GetMaterials(Material[])
      • GetPaddingForMaterial()
      • GetPaddingForMaterial(Material)
      • GetSharedMaterials()
      • GetTextContainerLocalCorners()
      • GetTextInfo(String)
      • LoadFontAsset()
      • OnDestroy()
      • OnDidApplyAnimationProperties()
      • OnDisable()
      • OnEnable()
      • OnRectTransformDimensionsChange()
      • OnTransformParentChanged()
      • Rebuild(CanvasUpdate)
      • SetActiveSubMeshes(Boolean)
      • SetAllDirty()
      • SetArraySizes(TMP_Text.UnicodeChar[])
      • SetCulling()
      • SetFaceColor(Color32)
      • SetLayoutDirty()
      • SetMask(MaskingTypes, Vector4)
      • SetMask(MaskingTypes, Vector4, Single, Single)
      • 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 © 2023 Unity Technologies — Terms of use
    • 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 18 October 2023