TextMeshPro

Switch to component

Namespace: TMPro

/

Inherits from: MonoBehaviour

Description

A script interface for the TextMeshPro component.

See Also: TextMeshPro component.

Properties

alignment How lines of text are aligned (Left, Right, Center, Justified).
anchor Which point of the text shares the position of the Transform.
anchorDampening Prevents the anchor position from being adjusted unless the change exceeds 40% of the width of the underline character.
bounds The bounds of the text object. (Read-only)
color The default vertex color assigned to each character. Note: Color tags will override this default color unless overrideColorTags is set to true.
characterSpacing The amount of additional spacing between individual characters.
extraPadding Increases the size of the geometry for each character. It does not affect spacing between characters. Extra padding may be necessary when displaying small text to prevent clipping.
enableKerning Enables or disables kerning.
enableWordWrapping Enables or disables word wrapping. When disabled, the text will be displayed on a single line.
faceColor The color of the "_FaceColor" property of the material. Changing faceColor will result in an instance of the material.
font The TextMeshPro font asset used.
fontMaterial The material assigned to this text object. Assigning a material will result in an instance of the material.
fontSharedMaterial The material assigned to this text object. Using fontSharedMaterial will not result in an instance of the material.
fontSize The font size to use.
horizontalMapping Controls how the face and outline textures will be applied to the text object.
isOverlay Sets the RenderQueue along with Ztest to force the text to be drawn last and on top of scene elements.
lineLength Determines where word wrapping will occur.
lineSpacing The amount of additional spacing to be added between each lines of text.
outlineColor The color of the "_OutlineColor" property of the material. Changing outlineColor will result in an instance of the material.
outlineWidth The thickness of the characters outline. Setting this value will result in an instance of the font material.
overrideColorTags Overrides the color tags forcing the vertex colors to be the default font color.
text The text to be displayed.
verticalMapping Controls how the face and outline textures will be applied to the text object.

Functions

SetCharArray Character array containing the text to be displayed.
SetText Formatted string containing a pattern and a value representing the text to be displayed.
UpdateMeshPadding Function forcing a re-computation of the required mesh padding based on the material properties to prevent clipping.