{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class TMP_Text | TextMeshPro | 3.0.1
docs.unity3d.com
"{0}" の検索結果

    目次を表示する/隠す

    Class TMP_Text

    Base class which contains common properties and functions shared between the TextMeshPro and TextMeshProUGUI component.

    Inheritance
    object
    UIBehaviour
    Graphic
    MaskableGraphic
    TMP_Text
    TextMeshPro
    TextMeshProUGUI
    Implements
    ICanvasElement
    IClippable
    IMaskable
    IMaterialModifier
    Inherited Members
    MaskableGraphic.m_ShouldRecalculateStencil
    MaskableGraphic.m_MaskMaterial
    MaskableGraphic.m_StencilValue
    MaskableGraphic.GetModifiedMaterial(Material)
    MaskableGraphic.Cull(Rect, bool)
    MaskableGraphic.SetClipRect(Rect, bool)
    MaskableGraphic.SetClipSoftness(Vector2)
    MaskableGraphic.OnEnable()
    MaskableGraphic.OnDisable()
    MaskableGraphic.OnValidate()
    MaskableGraphic.OnTransformParentChanged()
    MaskableGraphic.OnCanvasHierarchyChanged()
    MaskableGraphic.RecalculateClipping()
    MaskableGraphic.RecalculateMasking()
    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.SetAllDirty()
    Graphic.SetLayoutDirty()
    Graphic.SetVerticesDirty()
    Graphic.SetMaterialDirty()
    Graphic.OnRectTransformDimensionsChange()
    Graphic.OnBeforeTransformParentChanged()
    Graphic.OnDestroy()
    Graphic.OnCullingChanged()
    Graphic.Rebuild(CanvasUpdate)
    Graphic.LayoutComplete()
    Graphic.GraphicUpdateComplete()
    Graphic.UpdateMaterial()
    Graphic.UpdateGeometry()
    Graphic.OnPopulateMesh(Mesh)
    Graphic.OnPopulateMesh(VertexHelper)
    Graphic.OnRebuildRequested()
    Graphic.Reset()
    Graphic.OnDidApplyAnimationProperties()
    Graphic.SetNativeSize()
    Graphic.Raycast(Vector2, Camera)
    Graphic.PixelAdjustPoint(Vector2)
    Graphic.GetPixelAdjustedRect()
    Graphic.CrossFadeColor(Color, float, bool, bool, bool)
    Graphic.RegisterDirtyLayoutCallback(UnityAction)
    Graphic.UnregisterDirtyLayoutCallback(UnityAction)
    Graphic.RegisterDirtyVerticesCallback(UnityAction)
    Graphic.UnregisterDirtyVerticesCallback(UnityAction)
    Graphic.RegisterDirtyMaterialCallback(UnityAction)
    Graphic.UnregisterDirtyMaterialCallback(UnityAction)
    Graphic.defaultGraphicMaterial
    Graphic.raycastTarget
    Graphic.raycastPadding
    Graphic.useLegacyMeshGeneration
    Graphic.depth
    Graphic.canvas
    Graphic.canvasRenderer
    Graphic.defaultMaterial
    Graphic.material
    Graphic.materialForRendering
    Graphic.mainTexture
    Graphic.workerMesh
    UIBehaviour.Awake()
    UIBehaviour.Start()
    UIBehaviour.IsActive()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.IsDestroyed()
    Namespace: TMPro
    Assembly: solution.dll
    Syntax
    public abstract class TMP_Text : MaskableGraphic, ICanvasElement, IClippable, IMaskable, IMaterialModifier

    Fields

    Name Description
    checkPaddingRequired
    isMaskUpdateRequired
    k_LargeNegativeFloat
    k_LargeNegativeInt
    k_LargeNegativeVector2
    k_LargePositiveFloat
    k_LargePositiveInt
    k_LargePositiveVector2
    m_AutoSizeIterationCount
    m_AutoSizeMaxIterationCount
    m_ElementAscender
    m_ElementDescender
    m_Ellipsis
    m_FXMatrix
    m_FontStyleInternal
    m_FontWeightInternal
    m_FontWeightStack
    m_GlyphHorizontalAdvanceAdjustment
    m_HighlightStateStack
    m_HorizontalAlignment
    m_InternalParsingBuffer

    Array containing the Unicode characters to be parsed.

    m_InternalParsingBufferSize

    The number of Unicode characters that have been parsed and contained in the m_InternalParsingBuffer

    m_IsAutoSizePointSizeSet
    m_IsDrivenLineSpacing
    m_IsTextObjectScaleStatic
    m_ItalicAngle
    m_ItalicAngleStack
    m_LayoutElement
    m_PageAscender
    m_PreviousPivotPosition

    Used to track potential changes in pivot position to allow us to ignore OnRectTransformDimensionsChange getting called due to rounding errors when using Stretch Anchors.

    m_PreviousRectTransformSize

    Used to track potential changes in RectTransform size to allow us to ignore OnRectTransformDimensionsChange getting called due to rounding errors when using Stretch Anchors.

    m_SavedEllipsisState
    m_SavedLastValidState
    m_SavedLineState
    m_SavedSoftLineBreakState
    m_SavedWordWrapState
    m_StyleSheet
    m_TextPreprocessor
    m_TextStyleHashCode
    m_TextStyleStackDepth
    m_TextStyleStacks
    m_Underline
    m_VertexBufferAutoSizeReduction
    m_VerticalAlignment
    m_actionStack
    m_attributeParameterValues
    m_autoSizeTextContainer
    m_baselineOffset
    m_baselineOffsetStack
    m_cSpacing
    m_cached_TextElement
    m_charWidthAdjDelta
    m_charWidthMaxAdj
    m_characterCount
    m_characterSpacing
    m_colorGradientPreset
    m_colorGradientPresetIsTinted
    m_colorGradientStack
    m_colorMode
    m_colorStack
    m_currentFontAsset
    m_currentFontSize
    m_currentMaterial
    m_currentMaterialIndex
    m_currentSpriteAsset
    m_defaultSpriteAsset
    m_enableAutoSizing
    m_enableExtraPadding
    m_enableKerning
    m_enableVertexGradient
    m_enableWordWrapping
    m_faceColor
    m_firstCharacterOfLine
    m_firstOverflowCharacterIndex
    m_firstVisibleCharacter
    m_firstVisibleCharacterOfLine
    m_flexibleHeight
    m_flexibleWidth
    m_fontAsset
    m_fontColor
    m_fontColor32
    m_fontColorGradient
    m_fontColorGradientPreset
    m_fontMaterial
    m_fontMaterials
    m_fontScale
    m_fontScaleMultiplier
    m_fontSharedMaterials
    m_fontSize
    m_fontSizeBase
    m_fontSizeMax
    m_fontSizeMin
    m_fontStyle
    m_fontStyleStack
    m_fontWeight
    m_geometrySortingOrder
    m_havePropertiesChanged
    m_horizontalMapping
    m_htmlColor
    m_htmlTag
    m_ignoreActiveState
    m_ignoreCulling
    m_indentStack
    m_input_CharArray
    m_isAwake
    m_isCalculatingPreferredValues
    m_isCharacterWrappingEnabled
    m_isCullingEnabled
    m_isFXMatrixSet
    m_isIgnoringAlignment
    m_isLayoutDirty
    m_isMaskingEnabled
    m_isMaterialDirty
    m_isNewPage
    m_isNonBreakingSpace
    m_isOrthographic
    m_isOverlay
    m_isParsingText
    m_isPreferredHeightDirty
    m_isPreferredWidthDirty
    m_isRichText
    m_isRightToLeft
    m_isSDFShader
    m_isTextTruncated
    m_isUsingBold
    m_isUsingLegacyAnimationComponent
    m_isVolumetricText
    m_lastCharacterOfLine
    m_lastVisibleCharacterOfLine
    m_layoutPriority
    m_lineHeight
    m_lineJustification
    m_lineJustificationStack
    m_lineNumber
    m_lineOffset
    m_lineSpacing
    m_lineSpacingDelta
    m_lineSpacingMax
    m_lineVisibleCharacterCount
    m_linkedTextComponent
    m_margin
    m_marginHeight
    m_marginLeft
    m_marginRight
    m_marginWidth
    m_materialReferenceIndexLookup
    m_materialReferenceStack
    m_materialReferences
    m_maxCapHeight
    m_maxFontSize
    m_maxHeight
    m_maxLineAscender
    m_maxLineDescender
    m_maxTextAscender
    m_maxVisibleCharacters
    m_maxVisibleLines
    m_maxVisibleWords
    m_maxWidth
    m_mesh
    m_meshExtents
    m_minFontSize
    m_minHeight
    m_minWidth
    m_monoSpacing
    m_outlineColor
    m_outlineWidth
    m_overflowMode
    m_overrideHtmlColors
    m_padding
    m_pageNumber
    m_pageToDisplay
    m_paragraphSpacing
    m_parseCtrlCharacters
    m_preferredHeight
    m_preferredWidth
    m_rectTransform
    m_renderMode
    m_renderedHeight
    m_renderedWidth
    m_sharedMaterial
    m_sizeStack
    m_spacing
    m_spriteAnimationID
    m_spriteAnimator
    m_spriteAsset
    m_spriteColor
    m_spriteCount
    m_spriteIndex
    m_startOfLineAscender
    m_startOfLineDescender
    m_strikethroughColor
    m_strikethroughColorStack
    m_tabSpacing
    m_text
    m_textAlignment
    m_textContainerLocalCorners
    m_textElementType
    m_textInfo
    m_tintAllSprites
    m_tintSprite
    m_totalCharacterCount
    m_transform
    m_underlineColor
    m_underlineColorStack
    m_useMaxVisibleDescender
    m_uvLineOffset
    m_verticalMapping
    m_width
    m_wordSpacing
    m_wordWrappingRatios
    m_xAdvance
    m_xmlAttribute
    s_colorWhite
    tag_Indent
    tag_LineIndent
    tag_NoParsing

    Properties

    Name Description
    alignment

    Text alignment options

    alpha

    Sets the vertex color alpha value.

    autoSizeTextContainer

    Enables control over setting the size of the text container to match the text object.

    bounds

    Returns the bounds of the mesh of the text object in world space.

    characterSpacing

    The amount of additional spacing between characters.

    characterWidthAdjustment

    Percentage the width of characters can be adjusted before text auto-sizing begins to reduce the point size.

    color

    This is the default vertex color assigned to each vertices. Color tags will override vertex colors unless the overrideColorTags is set.

    colorGradient

    Sets the vertex colors for each of the 4 vertices of the character quads.

    colorGradientPreset

    Set the vertex colors of the 4 vertices of each character quads.

    enableAutoSizing

    Enable text auto-sizing

    enableCulling

    Sets the culling on the shaders. Note changing this value will result in an instance of the material.

    enableKerning

    Determines if kerning is enabled or disabled.

    enableVertexGradient

    Determines if Vertex Color Gradient should be used

    enableWordWrapping

    Controls whether or not word wrapping is applied. When disabled, the text will be displayed on a single line.

    extraPadding

    Adds extra padding around each character. This may be necessary when the displayed text is very small to prevent clipping.

    faceColor

    Sets the color of the _FaceColor property of the assigned material. Changing face color will result in an instance of the material.

    firstOverflowCharacterIndex

    The first character which exceeds the vertical bounds of its text container.

    firstVisibleCharacter

    The first character which should be made visible in conjunction with the Text Overflow Linked mode.

    flexibleHeight
    flexibleWidth
    font

    The Font Asset to be assigned to this text object.

    fontMaterial

    The material to be assigned to this text object. An instance of the material will be assigned to the object's renderer.

    fontMaterials

    The materials to be assigned to this text object. An instance of the materials will be assigned.

    fontScale

    The scale of the current text.

    fontSharedMaterial

    The material to be assigned to this text object.

    fontSharedMaterials

    An array containing the materials used by the text object.

    fontSize

    The point size of the font.

    fontSizeMax

    Maximum point size of the font when text auto-sizing is enabled.

    fontSizeMin

    Minimum point size of the font when text auto-sizing is enabled.

    fontStyle

    The style of the text

    fontWeight

    Control the weight of the font if an alternative font asset is assigned for the given weight in the font asset editor.

    geometrySortingOrder

    Determines the sorting order of the geometry of the text object.

    havePropertiesChanged

    Property tracking if any of the text properties have changed. Flag is set before the text is regenerated.

    horizontalAlignment

    Horizontal alignment options

    horizontalMapping

    Controls how the face and outline textures will be applied to the text object.

    ignoreVisibility

    Forces objects that are not visible to get refreshed.

    isOrthographic
    isOverlay

    Sets the RenderQueue along with Ztest to force the text to be drawn last and on top of scene elements.

    isRightToLeftText
    isTextObjectScaleStatic

    Determines if a text object will be excluded from the InternalUpdate callback used to handle updates of SDF Scale when the scale of the text object or parent(s) changes.

    isTextOverflowing

    Indicates if the text exceeds the vertical bounds of its text container.

    isTextTruncated

    Property indicating whether the text is Truncated or using Ellipsis.

    isUsingBold

    Property used in conjunction with padding calculation for the geometry.

    isUsingLegacyAnimationComponent

    Property to handle legacy animation component.

    isVolumetricText

    Determines if the geometry of the characters will be quads or volumetric (cubes).

    layoutElement
    layoutPriority
    lineSpacing

    The amount of additional spacing to add between each lines of text.

    lineSpacingAdjustment

    The amount of potential line spacing adjustment before text auto sizing kicks in.

    linkedTextComponent

    The linked text component used for flowing the text from one text component to another.

    mappingUvLineOffset

    Controls the horizontal offset of the UV of the texture mapping mode for each line of the text object.

    margin

    The margins of the text object.

    maxHeight
    maxVisibleCharacters

    Allows to control how many characters are visible from the input.

    maxVisibleLines

    Allows control over how many lines of text are displayed.

    maxVisibleWords

    Allows to control how many words are visible from the input.

    maxWidth
    mesh

    The mesh used by the font asset and material assigned to the text object.

    minHeight
    minWidth
    outlineColor

    Sets the color of the _OutlineColor property of the assigned material. Changing outline color will result in an instance of the material.

    outlineWidth

    Sets the thickness of the outline of the font. Setting this value will result in an instance of the material.

    overflowMode

    Controls the Text Overflow Mode

    overrideColorTags

    This overrides the color tags forcing the vertex colors to be the default font color.

    pageToDisplay

    Controls which page of text is shown

    paragraphSpacing

    The amount of additional spacing to add between each lines of text.

    parseCtrlCharacters

    Enables or Disables parsing of CTRL characters in input text.

    pixelsPerUnit
    preferredHeight

    Computed preferred height of the text object.

    preferredWidth

    Computed preferred width of the text object.

    rectTransform

    Returns are reference to the RectTransform

    renderMode

    Determines if the Mesh will be rendered.

    renderedHeight

    Compute the rendered height of the text object.

    renderedWidth

    Compute the rendered width of the text object.

    richText

    Enables or Disables Rich Text Tags

    spriteAnimator

    Component used to control and animate sprites in the text object.

    spriteAsset

    Sprite Asset used by the text object.

    styleSheet

    Style sheet used by the text object.

    text

    A string containing the text to be displayed.

    textBounds

    Returns the bounds of the text of the text object.

    textInfo

    Returns data about the text object which includes information about each character, word, line, link, etc.

    textPreprocessor

    The ITextPreprocessor component referenced by the text object (if any)

    textStyle
    tintAllSprites

    Determines whether or not the sprite color is multiplies by the vertex color of the text.

    transform

    Returns are reference to the Transform

    useMaxVisibleDescender

    Determines if the text's vertical alignment will be adjusted based on visible descender of the text.

    vertexBufferAutoSizeReduction

    Determines if the data structures allocated to contain the geometry of the text object will be reduced in size if the number of characters required to display the text is reduced by more than 256 characters. This reduction has the benefit of reducing the amount of vertex data being submitted to the graphic device but results in GC when it occurs.

    verticalAlignment

    Vertical alignment options

    verticalMapping

    Controls how the face and outline textures will be applied to the text object.

    wordSpacing

    The amount of additional spacing between words.

    wordWrappingRatios

    Controls the blending between using character and word spacing to fill-in the space for justified text.

    Methods

    Name Description
    AdjustLineOffset(int, int, float)

    Method to adjust line spacing as a result of using different fonts or font point size.

    CalculatePreferredValues(ref float, Vector2, bool, bool)

    Method to calculate the preferred width and height of the text object.

    CharArrayToInternalParsingBuffer(char[], ref UnicodeChar[])

    Copies Content of formatted SetText() to charBuffer.

    ClearMesh()

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

    ClearMesh(bool)

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

    ComputeMarginSize()

    Function to force an update of the margin size.

    ConvertToFloat(char[], int, int)

    Extracts a float value from char[] assuming we know the position of the start, end and decimal point.

    ConvertToFloat(char[], int, int, out int)

    Extracts a float value from char[] given a start index and length.

    CreateMaterialInstance(Material)

    Function used to create an instance of the material

    CrossFadeAlpha(float, float, bool)

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

    CrossFadeColor(Color, float, bool, bool)

    Tweens the CanvasRenderer color associated with this Graphic.

    DestroySubMeshObjects()

    Destroy Sub Mesh Objects.

    DrawTextHighlight(Vector3, Vector3, ref int, Color32)
    DrawUnderlineMesh(Vector3, Vector3, ref int, float, float, float, float, Color32)

    Method to add the underline geometry.

    FillCharacterVertexBuffers(int, int)

    Store vertex attributes into the appropriate TMP_MeshInfo.

    FillCharacterVertexBuffers(int, int, bool)
    FillSpriteVertexBuffers(int, int)

    Fill Vertex Buffers for Sprites

    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()

    Method which parses the text input, does the layout of the text as well as generating the geometry.

    GetCompoundBounds()

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

    GetEllipsisSpecialCharacter(TMP_FontAsset)
    GetFontAssetForWeight(int)
    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.

    GetPaddingForMaterial()

    Get the padding value for the currently assigned material

    GetPaddingForMaterial(Material)

    Get the padding value for the given material

    GetParsedText()

    Function which returns the text after it has been parsed and rich text tags removed.

    GetPreferredHeight()

    Method to calculate the preferred height of a text object.

    GetPreferredValues()

    Function to Calculate the Preferred Width and Height of the text object.

    GetPreferredValues(float, float)

    Function to Calculate the Preferred Width and Height of the text object given the provided width and height.

    GetPreferredValues(string)

    Function to Calculate the Preferred Width and Height of the text object given a certain string.

    GetPreferredValues(string, float, float)

    Function to Calculate the Preferred Width and Height of the text object given a certain string and size of text container.

    GetPreferredWidth()

    Method to calculate the preferred width of a text object.

    GetRenderedHeight(bool)

    Method returning the rendered height of the text object.

    GetRenderedValues()

    Method returning the rendered width and height of the text object.

    GetRenderedValues(bool)
    GetRenderedWidth(bool)

    Method returning the rendered width of the text object.

    GetSharedMaterials()

    Method which returns an array containing the materials used by the text object.

    GetSpecialCharacters(TMP_FontAsset)

    Method used to find and cache references to the Underline and Ellipsis characters.

    GetTextBounds()

    Method which returns the bounds of the text object;

    GetTextBounds(bool)

    Method which returns the bounds of 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.

    GetUTF16(int[], int)
    GetUTF16(string, int)

    Convert UTF-16 Hex to Char

    GetUTF16(StringBuilder, int)

    Convert UTF-16 Hex to Char

    GetUTF32(int[], int)
    GetUTF32(string, int)

    Convert UTF-32 Hex to Char

    GetUTF32(StringBuilder, int)

    Convert UTF-32 Hex to Char

    GetUnderlineSpecialCharacter(TMP_FontAsset)
    HexCharsToColor(char[], int)

    Method to convert Hex color values to Color32

    HexCharsToColor(char[], int, int)

    Method to convert Hex Color values to Color32

    HexToInt(char)

    Method to convert Hex to Int

    InsertNewLine(int, float, float, float, float, float, float, float, float, ref bool, ref float)

    Function used in conjunction with GetTextInfo to figure out Array allocations.

    InternalCrossFadeAlpha(float, float, bool)
    InternalCrossFadeColor(Color, float, bool, bool)
    LoadDefaultSettings()

    Internal function used to load the default settings of text objects.

    LoadFontAsset()

    Method which derived classes need to override to load Font Assets.

    PackUV(float, float)
    PackUV(float, float, float)

    Function to pack scale information in the UV2 Channel.

    ParseInputText()

    Method to parse the input text based on its source

    ReplaceTagWithCharacter(int[], int, int, char)

    Replace a given number of characters (tag) in the array with a new character and shift subsequent characters in the array.

    ResizeLineExtents(int)

    Function to increase the size of the Line Extents Array.

    RestoreWordWrappingState(ref WordWrapState)

    Restore the State of various variables used in the mesh creation loop.

    SaveGlyphVertexInfo(float, float, Color32)

    Store vertex information for each character.

    SaveSpriteVertexInfo(Color32)

    Store vertex information for each sprite.

    SaveWordWrappingState(ref WordWrapState, int, int)

    Save the State of various variables used in the mesh creation loop in conjunction with Word Wrapping

    SetActiveSubMeshes(bool)

    Method to Enable or Disable child SubMesh objects.

    SetArraySizes(UnicodeChar[])

    Method used to determine the number of visible characters and required buffer allocations.

    SetCharArray(char[])

    Character array containing the text to be displayed.

    SetCharArray(char[], int, int)

    Character array containing the text to be displayed.

    SetCharArray(int[], int, int)

    Character array containing the text to be displayed.

    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.

    SetFontBaseMaterial(Material)

    Function called internally when assigning a new base material.

    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[])
    SetText(char[])

    Set the text using a char array.

    SetText(char[], int, int)

    Set the text using a char array with specified starting character and length.

    SetText(string, bool)
    SetText(string, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float, float, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float, float, float, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float, float, float, float, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(string, float, float, float, float, float, float, float, float)

    Formatted string containing a pattern and a value representing the text to be rendered.

    Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f);

    Results "A = 10.75, B = 11, C = 010.8."

    SetText(StringBuilder)

    Set the text using a StringBuilder.

    SetTextSortingOrder(int[])

    Function to sort the geometry of the text object in accordance to the provided order.

    SetTextSortingOrder(VertexSortingOrder)

    Function to control the sorting of the geometry of the text object.

    SetVertexColorGradient(TMP_ColorGradient)
    SetVertices(Vector3[])

    Function to push a new set of vertices to the mesh.

    StringBuilderToInternalParsingBuffer(StringBuilder, ref UnicodeChar[])

    Copy contents of StringBuilder into int array.

    StringToInternalParsingBuffer(string, ref UnicodeChar[])

    Method to store the content of a string into an integer array.

    UpdateGeometry(Mesh, int)

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

    UpdateMeshPadding()

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

    UpdateVertexData()

    Function to push the updated vertex data into the mesh and renderer.

    UpdateVertexData(TMP_VertexDataUpdateFlags)

    Function to push the updated vertex data into the mesh and renderer.

    ValidateHtmlTag(UnicodeChar[], int, out int)

    Function to identify and validate the rich tag. Returns the position of the > if the tag was valid.

    Events

    Name Description
    OnFontAssetRequest
    OnPreRenderText

    Event delegate to allow modifying the text geometry before it is uploaded to the mesh and rendered.

    OnSpriteAssetRequest
    概要
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)