Scripting API

TMP_Text

class in TMPro · Unity.TextMeshPro · inherits from MaskableGraphic

134 of 370 of Unity's members
In Tassix

TextMeshPro's text: rich text, word wrapping, alignment, auto sizing and overflow, laid out in the font's exact (unhinted) metrics as TextMeshPro does, with the results in textInfo.
Glyphs are drawn as bitmaps rasterized at the text's on-screen size (not from a signed distance field), so outlines, underlay and other SDF material effects aren't drawn.

Properties 81

TextAlignmentOptions alignment { get; set; }
float alpha { get; set; }
virtual bool autoSizeTextContainer { get; set; }
Bounds bounds { get; }
float characterSpacing { get; set; }
float characterWidthAdjustment { get; set; }
Color color { get; set; }
bool enableAutoSizing { get; set; }
bool enableCulling { get; set; }
bool enableKerning { get; set; }
bool enableVertexGradient { get; set; }
bool enableWordWrapping { get; set; }
bool extraPadding { get; set; }
Color32 faceColor { get; set; }
int firstOverflowCharacterIndex { get; }
int firstVisibleCharacter { get; set; }
float flexibleHeight { get; }
float flexibleWidth { get; }
TMP_FontAsset font { get; set; }
Material fontMaterial { get; set; }
virtual Material[] fontMaterials { get; set; }
virtual Material fontSharedMaterial { get; set; }
virtual Material[] fontSharedMaterials { get; set; }
float fontSize { get; set; }
float fontSizeMax { get; set; }
float fontSizeMin { get; set; }
FontStyles fontStyle { get; set; }
FontWeight fontWeight { get; set; }
VertexSortingOrder geometrySortingOrder { get; set; }
bool havePropertiesChanged { get; set; }
HorizontalAlignmentOptions horizontalAlignment { get; set; }
TextureMappingOptions horizontalMapping { get; set; }
bool ignoreVisibility { get; set; }
bool isOrthographic { get; set; }
bool isOverlay { get; set; }
bool isTextObjectScaleStatic { get; set; }
bool isTextOverflowing { get; }
bool isTextTruncated { get; }
bool isUsingBold { get; }
bool isUsingLegacyAnimationComponent { get; set; }
bool isVolumetricText { get; set; }
int layoutPriority { get; }
float lineSpacing { get; set; }
float lineSpacingAdjustment { get; set; }
Texture mainTexture { get; }
float mappingUvLineOffset { get; set; }
virtual Vector4 margin { get; set; }
float maxHeight { get; }
int maxVisibleCharacters { get; set; }
int maxVisibleLines { get; set; }
int maxVisibleWords { get; set; }
float maxWidth { get; }
virtual Mesh mesh { get; }
float minHeight { get; }
float minWidth { get; }
Color32 outlineColor { get; set; }

The outline's color (on a distance field material; overrides the material's).

float outlineWidth { get; set; }

The outline's width, 0 to 1 (overrides the material's _OutlineWidth when above 0).

TextOverflowModes overflowMode { get; set; }
bool overrideColorTags { get; set; }
int pageToDisplay { get; set; }
float paragraphSpacing { get; set; }
bool parseCtrlCharacters { get; set; }
float pixelsPerUnit { get; }
float preferredHeight { get; }
float preferredWidth { get; }
RectTransform rectTransform { get; }
TextRenderFlags renderMode { get; set; }
float renderedHeight { get; }
float renderedWidth { get; }
bool richText { get; set; }
virtual string text { get; set; }
Bounds textBounds { get; }
TMP_TextInfo textInfo { get; }
TextWrappingModes textWrappingMode { get; set; }
Transform transform { get; }
bool useMaxVisibleDescender { get; set; }
bool vertexBufferAutoSizeReduction { get; set; }
VerticalAlignmentOptions verticalAlignment { get; set; }
TextureMappingOptions verticalMapping { get; set; }
float wordSpacing { get; set; }
float wordWrappingRatios { get; set; }

Methods 12

virtual void CalculateLayoutInputHorizontal()
virtual void CalculateLayoutInputVertical()
void ClearMesh()
virtual void ForceMeshUpdate(bool ignoreActiveState = false, bool forceTextReparsing = false)

Lays the text out now (textInfo is current afterwards).

string GetParsedText()
Vector2 GetPreferredValues()
Vector2 GetPreferredValues(float width, float height)
Vector2 GetPreferredValues(string text)
Vector2 GetPreferredValues(string text, float width, float height)
Vector2 GetRenderedValues()
Vector2 GetRenderedValues(bool onlyVisibleCharacters)
TMP_TextInfo GetTextInfo(string text)
void SetCharArray(char[] sourceText)
void SetCharArray(char[] sourceText, int start, int length)
void SetText(string sourceText)
void SetText(string sourceText, bool syncTextInputBox)
void SetText(string sourceText, float arg0)
void SetText(string sourceText, float arg0, float arg1)
void SetText(string sourceText, float arg0, float arg1, float arg2)
void SetText(string sourceText, float arg0, float arg1, float arg2, float arg3)
void SetText(string sourceText, float arg0, float arg1, float arg2, float arg3, float arg4)
void SetText(string sourceText, float arg0, float arg1, float arg2, float arg3, float arg4, float arg5)
void SetText(string sourceText, float arg0, float arg1, float arg2, float arg3, float arg4, float arg5, float arg6)
void SetText(string sourceText, float arg0, float arg1, float arg2, float arg3, float arg4, float arg5, float arg6, float arg7)
void SetText(StringBuilder sourceText)
void SetText(char[] sourceText)
void SetText(char[] sourceText, int start, int length)
virtual void UpdateGeometry(Mesh mesh, int index)
virtual void UpdateVertexData()
virtual void UpdateVertexData(TMP_VertexDataUpdateFlags flags)

Sends the (edited) textInfo.meshInfo vertices to the renderer, without laying the text out again.

Not in Tassix yet 236

AdjustLineOffset CalculatePreferredValues ComputeMarginSize ConvertToFloat CreateMaterialInstance DestroySubMeshObjects DoMissingGlyphCallback DrawTextHighlight DrawUnderlineMesh FillCharacterVertexBuffers FillSpriteVertexBuffers GetCompoundBounds GetEllipsisSpecialCharacter GetFontAssetForWeight GetMaterial GetMaterials GetPaddingForMaterial GetPreferredHeight GetPreferredWidth GetRenderedHeight GetRenderedWidth GetSharedMaterials GetSpecialCharacters GetTextBounds GetTextContainerLocalCorners GetUnderlineSpecialCharacter HexCharsToColor HexToInt InternalCrossFadeAlpha InternalCrossFadeColor LoadDefaultSettings LoadFontAsset OnFontAssetRequest OnMissingCharacter OnPreRenderText OnSpriteAssetRequest OnValidate PackUV ParseInputText ReplaceTagWithCharacter ResizeLineExtents SaveGlyphVertexInfo SaveSpriteVertexInfo SetActiveSubMeshes SetCulling SetFaceColor SetFontBaseMaterial SetOutlineColor SetOutlineThickness SetShaderDepth SetSharedMaterial SetSharedMaterials SetTextSortingOrder SetVertexColorGradient SetVertices UpdateMeshPadding characterHorizontalScale checkPaddingRequired colorGradient colorGradientPreset emojiFallbackSupport fontFeatures isMaskUpdateRequired isRightToLeftText k_LargeNegativeFloat k_LargeNegativeInt k_LargeNegativeVector2 k_LargePositiveFloat k_LargePositiveInt k_LargePositiveVector2 layoutElement linkedTextComponent m_ActiveFontFeatures m_AutoSizeIterationCount m_AutoSizeMaxIterationCount m_ElementAscender m_ElementDescender m_Ellipsis m_FXRotation m_FXScale m_FontStyleInternal m_FontWeightInternal m_FontWeightStack m_HighlightStateStack m_IsAutoSizePointSizeSet m_IsDrivenLineSpacing m_ItalicAngle m_ItalicAngleStack m_LastBaseGlyphIndex m_LayoutElement m_PageAscender m_PreviousPivotPosition m_PreviousRectTransformSize m_RenderedHeight m_RenderedWidth m_StyleSheet m_TextPreprocessor m_TextStyleHashCode m_TextStyleStackDepth m_TextStyleStacks m_Underline m_VertexBufferAutoSizeReduction m_actionStack m_autoSizeTextContainer m_baselineOffset m_baselineOffsetStack m_cSpacing m_cached_TextElement m_charWidthAdjDelta m_characterCount m_colorGradientPreset m_colorGradientPresetIsTinted m_colorGradientStack m_colorMode m_colorStack m_currentEnvMapRotation m_currentFontAsset m_currentFontSize m_currentMaterial m_currentMaterialIndex m_currentSpriteAsset m_defaultSpriteAsset m_duoSpace m_faceColor m_firstCharacterOfLine m_firstOverflowCharacterIndex m_firstVisibleCharacterOfLine m_flexibleHeight m_flexibleWidth m_fontColorGradient m_fontColorGradientPreset m_fontMaterial m_fontMaterials m_fontScaleMultiplier m_fontSharedMaterials m_fontStyleStack m_hasEnvMapProperty m_htmlColor m_ignoreActiveState m_ignoreCulling m_indentStack m_isAwake m_isCalculatingPreferredValues m_isCharacterWrappingEnabled m_isCullingEnabled m_isIgnoringAlignment m_isLayoutDirty m_isMaskingEnabled m_isMaterialDirty m_isNewPage m_isNonBreakingSpace m_isOverlay m_isPreferredHeightDirty m_isPreferredWidthDirty m_isRightToLeft m_isSDFShader m_isTextLayoutPhase 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_lineSpacingDelta m_lineVisibleCharacterCount m_lineVisibleSpaceCount m_linkedTextComponent 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_maxWidth m_mesh m_meshExtents m_minFontSize m_minHeight m_minWidth m_monoSpacing m_outlineColor m_outlineWidth m_padding m_pageNumber m_preferredHeight m_preferredWidth m_rectTransform m_renderMode 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_textContainerLocalCorners m_textElementType m_tintAllSprites m_tintSprite m_totalCharacterCount m_transform m_underlineColor m_underlineColorStack m_useMaxVisibleDescender m_uvLineOffset m_width m_xAdvance s_colorWhite spriteAnimator spriteAsset styleSheet tag_Indent tag_LineIndent tag_NoParsing textPreprocessor textStyle tintAllSprites