Hue Preserving Color Blending
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Private Member Functions | Private Attributes | List of all members
TMPro.TMP_Text Class Reference

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

Inheritance diagram for TMPro.TMP_Text:
TMPro.TextMeshPro TMPro.TextMeshProUGUI

Public Member Functions

virtual void ForceMeshUpdate ()
 Function to force the regeneration of the text object. More...
 
virtual void ForceMeshUpdate (bool ignoreActiveState)
 Method used for resetting vertex layout when switching to and from Volumetric Text mode. More...
 
virtual void UpdateGeometry (Mesh mesh, int index)
 Function to force the regeneration of the text object. More...
 
virtual void UpdateVertexData (TMP_VertexDataUpdateFlags flags)
 Function to push the updated vertex data into the mesh and renderer. More...
 
virtual void UpdateVertexData ()
 Function to push the updated vertex data into the mesh and renderer. More...
 
virtual void SetVertices (Vector3[] vertices)
 Function to push a new set of vertices to the mesh. More...
 
virtual void UpdateMeshPadding ()
 Function to be used to force recomputing of character padding when Shader / Material properties have been changed via script. More...
 
override void CrossFadeColor (Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
 
override void CrossFadeAlpha (float alpha, float duration, bool ignoreTimeScale)
 Tweens the alpha of the CanvasRenderer color associated with this Graphic. More...
 
void SetText (string text)
 
void SetText (string text, bool syncTextInputBox)
 
void SetText (string text, float arg0)
 
void SetText (string text, float arg0, float arg1)
 
void SetText (string text, float arg0, float arg1, float arg2)
 
void SetText (StringBuilder text)
 Set the text using a StringBuilder. More...
 
void SetCharArray (char[] sourceText)
 Character array containing the text to be displayed. More...
 
void SetCharArray (char[] sourceText, int start, int length)
 Character array containing the text to be displayed. More...
 
void SetCharArray (int[] sourceText, int start, int length)
 Character array containing the text to be displayed. More...
 
Vector2 GetPreferredValues ()
 Function to Calculate the Preferred Width and Height of the text object. More...
 
Vector2 GetPreferredValues (float width, float height)
 Function to Calculate the Preferred Width and Height of the text object given the provided width and height. More...
 
Vector2 GetPreferredValues (string text)
 Function to Calculate the Preferred Width and Height of the text object given a certain string. More...
 
Vector2 GetPreferredValues (string text, float width, float height)
 Function to Calculate the Preferred Width and Height of the text object given a certain string and size of text container. More...
 
Vector2 GetRenderedValues ()
 Method returning the rendered width and height of the text object. More...
 
Vector2 GetRenderedValues (bool onlyVisibleCharacters)
 
virtual TMP_TextInfo GetTextInfo (string text)
 Function used to evaluate the length of a text string. More...
 
virtual void ComputeMarginSize ()
 Function to force an update of the margin size. More...
 
virtual void ClearMesh ()
 Function to clear the geometry of the Primary and Sub Text objects. More...
 
virtual void ClearMesh (bool uploadGeometry)
 Function to clear the geometry of the Primary and Sub Text objects. More...
 
virtual string GetParsedText ()
 Function which returns the text after it has been parsed and rich text tags removed. More...
 

Protected Types

enum  TextInputSources { Text = 0, SetText = 1, SetCharArray = 2, String = 3 }
 

Protected Member Functions

virtual void LoadFontAsset ()
 Method which derived classes need to override to load Font Assets. More...
 
virtual void SetSharedMaterial (Material mat)
 Function called internally when a new shared material is assigned via the fontSharedMaterial property. More...
 
virtual Material GetMaterial (Material mat)
 Function called internally when a new material is assigned via the fontMaterial property. More...
 
virtual void SetFontBaseMaterial (Material mat)
 Function called internally when assigning a new base material. More...
 
virtual Material [] GetSharedMaterials ()
 Method which returns an array containing the materials used by the text object. More...
 
virtual void SetSharedMaterials (Material[] materials)
 
virtual Material [] GetMaterials (Material[] mats)
 Method returning instances of the materials used by the text object. More...
 
virtual Material CreateMaterialInstance (Material source)
 Method to set the materials of the text and sub text objects. More...
 
void SetVertexColorGradient (TMP_ColorGradient gradient)
 
void SetTextSortingOrder (VertexSortingOrder order)
 Function to control the sorting of the geometry of the text object. More...
 
void SetTextSortingOrder (int[] order)
 Function to sort the geometry of the text object in accordance to the provided order. More...
 
virtual void SetFaceColor (Color32 color)
 Function called internally to set the face color of the material. This will results in an instance of the material. More...
 
virtual void SetOutlineColor (Color32 color)
 Function called internally to set the outline color of the material. This will results in an instance of the material. More...
 
virtual void SetOutlineThickness (float thickness)
 Function called internally to set the outline thickness property of the material. This will results in an instance of the material. More...
 
virtual void SetShaderDepth ()
 Set the Render Queue and ZTest mode on the current material More...
 
virtual void SetCulling ()
 Set the culling mode on the material. More...
 
virtual float GetPaddingForMaterial ()
 Get the padding value for the currently assigned material More...
 
virtual float GetPaddingForMaterial (Material mat)
 Get the padding value for the given material More...
 
virtual Vector3 [] GetTextContainerLocalCorners ()
 Method to return the local corners of the Text Container or RectTransform. More...
 
virtual void InternalCrossFadeColor (Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
 
virtual void InternalCrossFadeAlpha (float alpha, float duration, bool ignoreTimeScale)
 
void ParseInputText ()
 Method to parse the input text based on its source More...
 
void SetTextArrayToCharArray (char[] sourceText, ref int[] charBuffer)
 Copies Content of formatted SetText() to charBuffer. More...
 
void StringToCharArray (string sourceText, ref int[] charBuffer)
 Method to store the content of a string into an integer array. More...
 
void StringBuilderToIntArray (StringBuilder sourceText, ref int[] charBuffer)
 Copy contents of StringBuilder into int array. More...
 
void AddFloatToCharArray (float number, ref int index, int precision)
 Function used in conjunction with SetText() More...
 
void AddIntToCharArray (int number, ref int index, int precision)
 // Function used in conjunction with SetText() More...
 
virtual int SetArraySizes (int[] chars)
 Method used to determine the number of visible characters and required buffer allocations. More...
 
virtual void GenerateTextMesh ()
 Method which parses the text input, does the layout of the text as well as generating the geometry. More...
 
float GetPreferredWidth ()
 Method to calculate the preferred width of a text object. More...
 
float GetPreferredWidth (Vector2 margin)
 Method to calculate the preferred width of a text object. More...
 
float GetPreferredHeight ()
 Method to calculate the preferred height of a text object. More...
 
float GetPreferredHeight (Vector2 margin)
 Method to calculate the preferred height of a text object. More...
 
float GetRenderedWidth ()
 Method returning the rendered width of the text object. More...
 
float GetRenderedWidth (bool onlyVisibleCharacters)
 Method returning the rendered width of the text object. More...
 
float GetRenderedHeight ()
 Method returning the rendered height of the text object. More...
 
float GetRenderedHeight (bool onlyVisibleCharacters)
 Method returning the rendered height of the text object. More...
 
virtual Vector2 CalculatePreferredValues (float defaultFontSize, Vector2 marginSize, bool ignoreTextAutoSizing)
 Method to calculate the preferred width and height of the text object. More...
 
virtual Bounds GetCompoundBounds ()
 Method returning the compound bounds of the text object and child sub objects. More...
 
Bounds GetTextBounds ()
 Method which returns the bounds of the text object; More...
 
Bounds GetTextBounds (bool onlyVisibleCharacters)
 Method which returns the bounds of the text object; More...
 
virtual void AdjustLineOffset (int startIndex, int endIndex, float offset)
 Method to adjust line spacing as a result of using different fonts or font point size. More...
 
void ResizeLineExtents (int size)
 Function to increase the size of the Line Extents Array. More...
 
void SaveWordWrappingState (ref WordWrapState state, int index, int count)
 Function used in conjunction with GetTextInfo to figure out Array allocations. More...
 
int RestoreWordWrappingState (ref WordWrapState state)
 Restore the State of various variables used in the mesh creation loop. More...
 
virtual void SaveGlyphVertexInfo (float padding, float style_padding, Color32 vertexColor)
 Store vertex information for each character. More...
 
virtual void SaveSpriteVertexInfo (Color32 vertexColor)
 Store vertex information for each sprite. More...
 
virtual void FillCharacterVertexBuffers (int i, int index_X4)
 Store vertex attributes into the appropriate TMP_MeshInfo. More...
 
virtual void FillCharacterVertexBuffers (int i, int index_X4, bool isVolumetric)
 
virtual void FillSpriteVertexBuffers (int i, int index_X4)
 Fill Vertex Buffers for Sprites More...
 
virtual void DrawUnderlineMesh (Vector3 start, Vector3 end, ref int index, float startScale, float endScale, float maxScale, float sdfScale, Color32 underlineColor)
 Method to add the underline geometry. More...
 
virtual void DrawTextHighlight (Vector3 start, Vector3 end, ref int index, Color32 highlightColor)
 
void LoadDefaultSettings ()
 Internal function used to load the default settings of text objects. More...
 
void GetSpecialCharacters (TMP_FontAsset fontAsset)
 Method used to find and cache references to the Underline and Ellipsis characters. More...
 
void ReplaceTagWithCharacter (int[] chars, int insertionIndex, int tagLength, char c)
 Replace a given number of characters (tag) in the array with a new character and shift subsequent characters in the array. More...
 
TMP_FontAsset GetFontAssetForWeight (int fontWeight)
 
virtual void SetActiveSubMeshes (bool state)
 Method to Enable or Disable child SubMesh objects. More...
 
virtual void ClearSubMeshObjects ()
 Destroy Sub Mesh Objects. More...
 
Vector2 PackUV (float x, float y, float scale)
 Function to pack scale information in the UV2 Channel. More...
 
float PackUV (float x, float y)
 
int HexToInt (char hex)
 Function to pack scale information in the UV2 Channel. More...
 
int GetUTF16 (string text, int i)
 Convert UTF-16 Hex to Char More...
 
int GetUTF16 (StringBuilder text, int i)
 Convert UTF-16 Hex to Char More...
 
int GetUTF32 (string text, int i)
 Convert UTF-32 Hex to Char More...
 
int GetUTF32 (StringBuilder text, int i)
 Convert UTF-32 Hex to Char More...
 
Color32 HexCharsToColor (char[] hexChars, int tagCount)
 Method to convert Hex color values to Color32 More...
 
Color32 HexCharsToColor (char[] hexChars, int startIndex, int length)
 Method to convert Hex Color values to Color32 More...
 
float ConvertToFloat (char[] chars, int startIndex, int length)
 Extracts a float value from char[] assuming we know the position of the start, end and decimal point. More...
 
float ConvertToFloat (char[] chars, int startIndex, int length, out int lastIndex)
 Extracts a float value from char[] given a start index and length. More...
 
bool ValidateHtmlTag (int[] chars, int startIndex, out int endIndex)
 Function to identify and validate the rich tag. Returns the position of the > if the tag was valid. More...
 

Protected Attributes

string m_text
 
bool m_isRightToLeft = false
 
TMP_FontAsset m_fontAsset
 
TMP_FontAsset m_currentFontAsset
 
bool m_isSDFShader
 
Material m_sharedMaterial
 
Material m_currentMaterial
 
MaterialReference [] m_materialReferences = new MaterialReference[32]
 
Dictionary< int, int > m_materialReferenceIndexLookup = new Dictionary<int, int>()
 
TMP_XmlTagStack< MaterialReferencem_materialReferenceStack = new TMP_XmlTagStack<MaterialReference>(new MaterialReference[16])
 
int m_currentMaterialIndex
 
Material [] m_fontSharedMaterials
 
Material m_fontMaterial
 
Material [] m_fontMaterials
 
bool m_isMaterialDirty
 
Color32 m_fontColor32 = Color.white
 
Color m_fontColor = Color.white
 
Color32 m_underlineColor = s_colorWhite
 
Color32 m_strikethroughColor = s_colorWhite
 
Color32 m_highlightColor = s_colorWhite
 
bool m_enableVertexGradient
 
ColorMode m_colorMode = ColorMode.FourCornersGradient
 
VertexGradient m_fontColorGradient = new VertexGradient(Color.white)
 
TMP_ColorGradient m_fontColorGradientPreset
 
TMP_SpriteAsset m_spriteAsset
 
bool m_tintAllSprites
 
bool m_tintSprite
 
Color32 m_spriteColor
 
bool m_overrideHtmlColors = false
 
Color32 m_faceColor = Color.white
 
Color32 m_outlineColor = Color.black
 
float m_outlineWidth = 0.0f
 
float m_fontSize = 36
 
float m_currentFontSize
 
float m_fontSizeBase = 36
 
TMP_XmlTagStack< float > m_sizeStack = new TMP_XmlTagStack<float>(new float[16])
 
int m_fontWeight = 400
 
int m_fontWeightInternal
 
TMP_XmlTagStack< int > m_fontWeightStack = new TMP_XmlTagStack<int>(new int[16])
 
bool m_enableAutoSizing
 
float m_maxFontSize
 
float m_minFontSize
 
float m_fontSizeMin = 0
 
float m_fontSizeMax = 0
 
FontStyles m_fontStyle = FontStyles.Normal
 
FontStyles m_style = FontStyles.Normal
 
TMP_BasicXmlTagStack m_fontStyleStack
 
bool m_isUsingBold = false
 
TextAlignmentOptions m_textAlignment = TextAlignmentOptions.TopLeft
 
TextAlignmentOptions m_lineJustification
 
TMP_XmlTagStack< TextAlignmentOptions > m_lineJustificationStack = new TMP_XmlTagStack<TextAlignmentOptions>(new TextAlignmentOptions[16])
 
Vector3 [] m_textContainerLocalCorners = new Vector3[4]
 
bool m_isAlignmentEnumConverted
 
float m_characterSpacing = 0
 
float m_cSpacing = 0
 
float m_monoSpacing = 0
 
float m_wordSpacing = 0
 
float m_lineSpacing = 0
 
float m_lineSpacingDelta = 0
 
float m_lineHeight = TMP_Math.FLOAT_UNSET
 
float m_lineSpacingMax = 0
 
float m_paragraphSpacing = 0
 
float m_charWidthMaxAdj = 0f
 
float m_charWidthAdjDelta = 0
 
bool m_enableWordWrapping = false
 
bool m_isCharacterWrappingEnabled = false
 
bool m_isNonBreakingSpace = false
 
bool m_isIgnoringAlignment
 
float m_wordWrappingRatios = 0.4f
 
TextOverflowModes m_overflowMode = TextOverflowModes.Overflow
 
int m_firstOverflowCharacterIndex = -1
 
TMP_Text m_linkedTextComponent
 
bool m_isLinkedTextComponent
 
bool m_isTextTruncated
 
bool m_enableKerning
 
bool m_enableExtraPadding = false
 
bool checkPaddingRequired
 
bool m_isRichText = true
 
bool m_parseCtrlCharacters = true
 
bool m_isOverlay = false
 
bool m_isOrthographic = false
 
bool m_isCullingEnabled = false
 
bool m_ignoreRectMaskCulling
 
bool m_ignoreCulling = true
 
TextureMappingOptions m_horizontalMapping = TextureMappingOptions.Character
 
TextureMappingOptions m_verticalMapping = TextureMappingOptions.Character
 
float m_uvLineOffset = 0.0f
 
TextRenderFlags m_renderMode = TextRenderFlags.Render
 
VertexSortingOrder m_geometrySortingOrder
 
int m_firstVisibleCharacter
 
int m_maxVisibleCharacters = 99999
 
int m_maxVisibleWords = 99999
 
int m_maxVisibleLines = 99999
 
bool m_useMaxVisibleDescender = true
 
int m_pageToDisplay = 1
 
bool m_isNewPage = false
 
Vector4 m_margin = new Vector4(0, 0, 0, 0)
 
float m_marginLeft
 
float m_marginRight
 
float m_marginWidth
 
float m_marginHeight
 
float m_width = -1
 
TMP_TextInfo m_textInfo
 
bool m_havePropertiesChanged
 
bool m_isUsingLegacyAnimationComponent
 
Transform m_transform
 
RectTransform m_rectTransform
 
bool m_autoSizeTextContainer
 
Mesh m_mesh
 
bool m_isVolumetricText
 
TMP_SpriteAnimator m_spriteAnimator
 
float m_flexibleHeight = -1f
 
float m_flexibleWidth = -1f
 
float m_minWidth
 
float m_minHeight
 
float m_maxWidth
 
float m_maxHeight
 
LayoutElement m_LayoutElement
 
float m_preferredWidth
 
float m_renderedWidth
 
bool m_isPreferredWidthDirty
 
float m_preferredHeight
 
float m_renderedHeight
 
bool m_isPreferredHeightDirty
 
bool m_isCalculatingPreferredValues
 
int m_layoutPriority = 0
 
bool m_isCalculateSizeRequired = false
 
bool m_isLayoutDirty
 
bool m_verticesAlreadyDirty
 
bool m_layoutAlreadyDirty
 
bool m_isAwake
 
bool m_isWaitingOnResourceLoad
 
bool m_isInputParsingRequired = false
 
TextInputSources m_inputSource
 
string old_text
 
float m_fontScale
 
float m_fontScaleMultiplier
 
char [] m_htmlTag = new char[128]
 
XML_TagAttribute [] m_xmlAttribute = new XML_TagAttribute[8]
 
float [] m_attributeParameterValues = new float[16]
 
float tag_LineIndent = 0
 
float tag_Indent = 0
 
TMP_XmlTagStack< float > m_indentStack = new TMP_XmlTagStack<float>(new float[16])
 
bool tag_NoParsing
 
bool m_isParsingText
 
Matrix4x4 m_FXMatrix
 
bool m_isFXMatrixSet
 
int [] m_char_buffer
 
char [] m_input_CharArray = new char[256]
 
int m_totalCharacterCount
 
WordWrapState m_SavedWordWrapState = new WordWrapState()
 
WordWrapState m_SavedLineState = new WordWrapState()
 
int m_characterCount
 
int m_firstCharacterOfLine
 
int m_firstVisibleCharacterOfLine
 
int m_lastCharacterOfLine
 
int m_lastVisibleCharacterOfLine
 
int m_lineNumber
 
int m_lineVisibleCharacterCount
 
int m_pageNumber
 
float m_maxAscender
 
float m_maxCapHeight
 
float m_maxDescender
 
float m_maxLineAscender
 
float m_maxLineDescender
 
float m_startOfLineAscender
 
float m_lineOffset
 
Extents m_meshExtents
 
Color32 m_htmlColor = new Color(255, 255, 255, 128)
 
TMP_XmlTagStack< Color32 > m_colorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
TMP_XmlTagStack< Color32 > m_underlineColorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
TMP_XmlTagStack< Color32 > m_strikethroughColorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
TMP_XmlTagStack< Color32 > m_highlightColorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
TMP_ColorGradient m_colorGradientPreset
 
TMP_XmlTagStack< TMP_ColorGradientm_colorGradientStack = new TMP_XmlTagStack<TMP_ColorGradient>(new TMP_ColorGradient[16])
 
float m_tabSpacing = 0
 
float m_spacing = 0
 
TMP_XmlTagStack< int > m_styleStack = new TMP_XmlTagStack<int>(new int[16])
 
TMP_XmlTagStack< int > m_actionStack = new TMP_XmlTagStack<int>(new int[16])
 
float m_padding = 0
 
float m_baselineOffset
 
TMP_XmlTagStack< float > m_baselineOffsetStack = new TMP_XmlTagStack<float>(new float[16])
 
float m_xAdvance
 
TMP_TextElementType m_textElementType
 
TMP_TextElement m_cached_TextElement
 
TMP_Glyph m_cached_Underline_GlyphInfo
 
TMP_Glyph m_cached_Ellipsis_GlyphInfo
 
TMP_SpriteAsset m_defaultSpriteAsset
 
TMP_SpriteAsset m_currentSpriteAsset
 
int m_spriteCount = 0
 
int m_spriteIndex
 
int m_spriteAnimationID
 
bool m_ignoreActiveState
 

Static Protected Attributes

static Color32 s_colorWhite = new Color32(255, 255, 255, 255)
 
static Vector2 k_LargePositiveVector2 = new Vector2(TMP_Math.INT_MAX, TMP_Math.INT_MAX)
 
static Vector2 k_LargeNegativeVector2 = new Vector2(TMP_Math.INT_MIN, TMP_Math.INT_MIN)
 
static float k_LargePositiveFloat = TMP_Math.FLOAT_MAX
 
static float k_LargeNegativeFloat = TMP_Math.FLOAT_MIN
 
static int k_LargePositiveInt = TMP_Math.INT_MAX
 
static int k_LargeNegativeInt = TMP_Math.INT_MIN
 

Properties

string text [get, set]
 A string containing the text to be displayed. More...
 
bool isRightToLeftText [get, set]
 
TMP_FontAsset font [get, set]
 The Font Asset to be assigned to this text object. More...
 
virtual Material fontSharedMaterial [get, set]
 The material to be assigned to this text object. More...
 
virtual Material [] fontSharedMaterials [get, set]
 An array containing the materials used by the text object. More...
 
Material fontMaterial [get, set]
 The material to be assigned to this text object. An instance of the material will be assigned to the object's renderer. More...
 
virtual Material [] fontMaterials [get, set]
 The materials to be assigned to this text object. An instance of the materials will be assigned. More...
 
override Color color [get, set]
 This is the default vertex color assigned to each vertices. Color tags will override vertex colors unless the overrideColorTags is set. More...
 
float alpha [get, set]
 Sets the vertex color alpha value. More...
 
bool enableVertexGradient [get, set]
 Determines if Vertex Color Gradient should be used More...
 
VertexGradient colorGradient [get, set]
 Sets the vertex colors for each of the 4 vertices of the character quads. More...
 
TMP_ColorGradient colorGradientPreset [get, set]
 Set the vertex colors of the 4 vertices of each character quads. More...
 
TMP_SpriteAsset spriteAsset [get, set]
 Default Sprite Asset used by the text object. More...
 
bool tintAllSprites [get, set]
 Determines whether or not the sprite color is multiplies by the vertex color of the text. More...
 
bool overrideColorTags [get, set]
 This overrides the color tags forcing the vertex colors to be the default font color. More...
 
Color32 faceColor [get, set]
 Sets the color of the _FaceColor property of the assigned material. Changing face color will result in an instance of the material. More...
 
Color32 outlineColor [get, set]
 Sets the color of the _OutlineColor property of the assigned material. Changing outline color will result in an instance of the material. More...
 
float outlineWidth [get, set]
 Sets the thickness of the outline of the font. Setting this value will result in an instance of the material. More...
 
float fontSize [get, set]
 The point size of the font. More...
 
float fontScale [get]
 The scale of the current text. More...
 
int fontWeight [get, set]
 Control the weight of the font if an alternative font asset is assigned for the given weight in the font asset editor. More...
 
float pixelsPerUnit [get]
 
bool enableAutoSizing [get, set]
 Enable text auto-sizing More...
 
float fontSizeMin [get, set]
 Minimum point size of the font when text auto-sizing is enabled. More...
 
float fontSizeMax [get, set]
 Maximum point size of the font when text auto-sizing is enabled. More...
 
FontStyles fontStyle [get, set]
 The style of the text More...
 
bool isUsingBold [get]
 Property used in conjunction with padding calculation for the geometry. More...
 
TextAlignmentOptions alignment [get, set]
 Text alignment options More...
 
float characterSpacing [get, set]
 Use the extents of the text geometry for alignment instead of font metrics. More...
 
float wordSpacing [get, set]
 The amount of additional spacing between words. More...
 
float lineSpacing [get, set]
 The amount of additional spacing to add between each lines of text. More...
 
float lineSpacingAdjustment [get, set]
 The amount of potential line spacing adjustment before text auto sizing kicks in. More...
 
float paragraphSpacing [get, set]
 The amount of additional spacing to add between each lines of text. More...
 
float characterWidthAdjustment [get, set]
 Percentage the width of characters can be adjusted before text auto-sizing begins to reduce the point size. More...
 
bool enableWordWrapping [get, set]
 Controls whether or not word wrapping is applied. When disabled, the text will be displayed on a single line. More...
 
float wordWrappingRatios [get, set]
 Controls the blending between using character and word spacing to fill-in the space for justified text. More...
 
TextOverflowModes overflowMode [get, set]
 
bool isTextOverflowing [get]
 Indicates if the text exceeds the vertical bounds of its text container. More...
 
int firstOverflowCharacterIndex [get]
 The first character which exceeds the vertical bounds of its text container. More...
 
TMP_Text linkedTextComponent [get, set]
 The linked text component used for flowing the text from one text component to another. More...
 
bool isLinkedTextComponent [get, set]
 Indicates whether this text component is linked to another. More...
 
bool isTextTruncated [get]
 Property indicating whether the text is Truncated or using Ellipsis. More...
 
bool enableKerning [get, set]
 Determines if kerning is enabled or disabled. More...
 
bool extraPadding [get, set]
 Adds extra padding around each character. This may be necessary when the displayed text is very small to prevent clipping. More...
 
bool richText [get, set]
 Enables or Disables Rich Text Tags More...
 
bool parseCtrlCharacters [get, set]
 Enables or Disables parsing of CTRL characters in input text. More...
 
bool isOverlay [get, set]
 Sets the RenderQueue along with Ztest to force the text to be drawn last and on top of scene elements. More...
 
bool isOrthographic [get, set]
 Sets Perspective Correction to Zero for Orthographic Camera mode & 0.875f for Perspective Camera mode. More...
 
bool enableCulling [get, set]
 Sets the culling on the shaders. Note changing this value will result in an instance of the material. More...
 
bool ignoreRectMaskCulling [get, set]
 Controls whether or not the text object will be culled when using a 2D Rect Mask. More...
 
bool ignoreVisibility [get, set]
 Forces objects that are not visible to get refreshed. More...
 
TextureMappingOptions horizontalMapping [get, set]
 Controls how the face and outline textures will be applied to the text object. More...
 
TextureMappingOptions verticalMapping [get, set]
 Controls how the face and outline textures will be applied to the text object. More...
 
float mappingUvLineOffset [get, set]
 Controls the UV Offset for the various texture mapping mode on the text object. More...
 
TextRenderFlags renderMode [get, set]
 Determines if the Mesh will be rendered. More...
 
VertexSortingOrder geometrySortingOrder [get, set]
 Determines the sorting order of the geometry of the text object. More...
 
int firstVisibleCharacter [get, set]
 The first character which should be made visible in conjunction with the Text Overflow Linked mode. More...
 
int maxVisibleCharacters [get, set]
 Allows to control how many characters are visible from the input. More...
 
int maxVisibleWords [get, set]
 Allows to control how many words are visible from the input. More...
 
int maxVisibleLines [get, set]
 Allows control over how many lines of text are displayed. More...
 
bool useMaxVisibleDescender [get, set]
 Determines if the text's vertical alignment will be adjusted based on visible descender of the text. More...
 
int pageToDisplay [get, set]
 Controls which page of text is shown More...
 
virtual Vector4 margin [get, set]
 The margins of the text object. More...
 
TMP_TextInfo textInfo [get]
 Returns data about the text object which includes information about each character, word, line, link, etc. More...
 
bool havePropertiesChanged [get, set]
 Property tracking if any of the text properties have changed. Flag is set before the text is regenerated. More...
 
bool isUsingLegacyAnimationComponent [get, set]
 Property to handle legacy animation component. More...
 
new Transform transform [get]
 Returns are reference to the Transform More...
 
new RectTransform rectTransform [get]
 Returns are reference to the RectTransform More...
 
virtual bool autoSizeTextContainer [get, set]
 Enables control over setting the size of the text container to match the text object. More...
 
virtual Mesh mesh [get]
 The mesh used by the font asset and material assigned to the text object. More...
 
bool isVolumetricText [get, set]
 Determines if the geometry of the characters will be quads or volumetric (cubes). More...
 
Bounds bounds [get]
 Returns the bounds of the mesh of the text object in world space. More...
 
Bounds textBounds [get]
 Returns the bounds of the text of the text object. More...
 
TMP_SpriteAnimator spriteAnimator [get]
 Component used to control wrapping of text following some arbitrary shape. More...
 
float flexibleHeight [get]
 
float flexibleWidth [get]
 
float minWidth [get]
 
float minHeight [get]
 
float maxWidth [get]
 
float maxHeight [get]
 
LayoutElement layoutElement [get]
 
virtual float preferredWidth [get]
 Computed preferred width of the text object. More...
 
virtual float preferredHeight [get]
 Computed preferred height of the text object. More...
 
virtual float renderedWidth [get]
 Compute the rendered width of the text object. More...
 
virtual float renderedHeight [get]
 Compute the rendered height of the text object. More...
 
int layoutPriority [get]
 

Private Member Functions

internal void SetTextInternal (string text)
 Internal function used by the Text Input Field to populate TMP_TextInfo data. More...
 
bool ReplaceOpeningStyleTag (ref string sourceText, int srcIndex, out int srcOffset, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by opening style definition. More...
 
bool ReplaceOpeningStyleTag (ref int[] sourceText, int srcIndex, out int srcOffset, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by opening style definition. More...
 
bool ReplaceOpeningStyleTag (ref char[] sourceText, int srcIndex, out int srcOffset, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by opening style definition. More...
 
bool ReplaceOpeningStyleTag (ref StringBuilder sourceText, int srcIndex, out int srcOffset, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by opening style definition. More...
 
bool ReplaceClosingStyleTag (ref string sourceText, int srcIndex, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by closing style definition. More...
 
bool ReplaceClosingStyleTag (ref int[] sourceText, int srcIndex, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by closing style definition. More...
 
bool ReplaceClosingStyleTag (ref char[] sourceText, int srcIndex, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by closing style definition. More...
 
bool ReplaceClosingStyleTag (ref StringBuilder sourceText, int srcIndex, ref int[] charBuffer, ref int writeIndex)
 Method to handle inline replacement of style tag by closing style definition. More...
 
bool IsTagName (ref string text, string tag, int index)
 Method to check for a matching rich text tag. More...
 
bool IsTagName (ref char[] text, string tag, int index)
 Method to check for a matching rich text tag. More...
 
bool IsTagName (ref int[] text, string tag, int index)
 Method to check for a matching rich text tag. More...
 
bool IsTagName (ref StringBuilder text, string tag, int index)
 Method to check for a matching rich text tag. More...
 
int GetTagHashCode (ref string text, int index, out int closeIndex)
 Get Hashcode for a given tag. More...
 
int GetTagHashCode (ref char[] text, int index, out int closeIndex)
 Get Hashcode for a given tag. More...
 
int GetTagHashCode (ref int[] text, int index, out int closeIndex)
 Get Hashcode for a given tag. More...
 
int GetTagHashCode (ref StringBuilder text, int index, out int closeIndex)
 Get Hashcode for a given tag. More...
 
void ResizeInternalArray< T > (ref T[] array)
 
int GetAttributeParameters (char[] chars, int startIndex, int length, ref float[] parameters)
 Method which returns the number of parameters used in a tag attribute and populates an array with such values. More...
 

Private Attributes

int m_recursiveCount
 
TMP_CharacterInfo [] m_internalCharacterInfo
 
int m_charArray_Length = 0
 
readonly float [] k_Power = { 5e-1f, 5e-2f, 5e-3f, 5e-4f, 5e-5f, 5e-6f, 5e-7f, 5e-8f, 5e-9f, 5e-10f }
 

Detailed Description

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

Definition at line 110 of file TMP_Text.cs.

Member Function Documentation

◆ AddFloatToCharArray()

void TMPro.TMP_Text.AddFloatToCharArray ( float  number,
ref int  index,
int  precision 
)
inlineprotected

Function used in conjunction with SetText()

Parameters
number
index
precision

Definition at line 3326 of file TMP_Text.cs.

◆ AddIntToCharArray()

void TMPro.TMP_Text.AddIntToCharArray ( int  number,
ref int  index,
int  precision 
)
inlineprotected

// Function used in conjunction with SetText()

Parameters
number
index
precision

Definition at line 3363 of file TMP_Text.cs.

◆ AdjustLineOffset()

virtual void TMPro.TMP_Text.AdjustLineOffset ( int  startIndex,
int  endIndex,
float  offset 
)
inlineprotectedvirtual

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

Parameters
startIndex
endIndex
offset

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 4498 of file TMP_Text.cs.

◆ CalculatePreferredValues()

virtual Vector2 TMPro.TMP_Text.CalculatePreferredValues ( float  defaultFontSize,
Vector2  marginSize,
bool  ignoreTextAutoSizing 
)
inlineprotectedvirtual

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

Returns

Definition at line 3677 of file TMP_Text.cs.

◆ ClearMesh() [1/2]

virtual void TMPro.TMP_Text.ClearMesh ( )
inlinevirtual

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

Reimplemented in TMPro.TextMeshProUGUI.

Definition at line 5521 of file TMP_Text.cs.

◆ ClearMesh() [2/2]

virtual void TMPro.TMP_Text.ClearMesh ( bool  uploadGeometry)
inlinevirtual

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

Reimplemented in TMPro.TextMeshPro.

Definition at line 5527 of file TMP_Text.cs.

◆ ClearSubMeshObjects()

virtual void TMPro.TMP_Text.ClearSubMeshObjects ( )
inlineprotectedvirtual

Destroy Sub Mesh Objects.

Reimplemented in TMPro.TextMeshPro.

Definition at line 5515 of file TMP_Text.cs.

◆ ComputeMarginSize()

virtual void TMPro.TMP_Text.ComputeMarginSize ( )
inlinevirtual

Function to force an update of the margin size.

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 4544 of file TMP_Text.cs.

◆ ConvertToFloat() [1/2]

float TMPro.TMP_Text.ConvertToFloat ( char []  chars,
int  startIndex,
int  length 
)
inlineprotected

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

Parameters
chars
startIndex
length
Returns

Definition at line 5894 of file TMP_Text.cs.

◆ ConvertToFloat() [2/2]

float TMPro.TMP_Text.ConvertToFloat ( char []  chars,
int  startIndex,
int  length,
out int  lastIndex 
)
inlineprotected

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

Parameters
chars

The Char[] containing the numerical sequence.

Parameters
startIndex

The index of the start of the numerical sequence.

Parameters
length

The length of the numerical sequence.

Parameters
lastIndex

Index of the last character in the validated sequence.

Returns

Definition at line 5909 of file TMP_Text.cs.

◆ CreateMaterialInstance()

virtual Material TMPro.TMP_Text.CreateMaterialInstance ( Material  source)
inlineprotectedvirtual

Method to set the materials of the text and sub text objects.

Parameters
mats

Function used to create an instance of the material

Parameters
source
Returns

Definition at line 1463 of file TMP_Text.cs.

◆ CrossFadeAlpha()

override void TMPro.TMP_Text.CrossFadeAlpha ( float  alpha,
float  duration,
bool  ignoreTimeScale 
)
inline

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

Parameters
alphaTarget alpha.
durationDuration of the tween in seconds.
ignoreTimeScaleShould ignore Time.scale?

Definition at line 1650 of file TMP_Text.cs.

◆ CrossFadeColor()

override void TMPro.TMP_Text.CrossFadeColor ( Color  targetColor,
float  duration,
bool  ignoreTimeScale,
bool  useAlpha 
)
inline

Tweens the CanvasRenderer color associated with this Graphic.

Parameters
targetColorTarget color.
durationTween duration.
ignoreTimeScaleShould ignore Time.scale?
useAlphaShould also Tween the alpha channel?

Definition at line 1637 of file TMP_Text.cs.

◆ DrawUnderlineMesh()

virtual void TMPro.TMP_Text.DrawUnderlineMesh ( Vector3  start,
Vector3  end,
ref int  index,
float  startScale,
float  endScale,
float  maxScale,
float  sdfScale,
Color32  underlineColor 
)
inlineprotectedvirtual

Method to add the underline geometry.

Parameters
start
end
startScale
endScale
maxScale
underlineColor

Definition at line 5167 of file TMP_Text.cs.

◆ FillCharacterVertexBuffers()

virtual void TMPro.TMP_Text.FillCharacterVertexBuffers ( int  i,
int  index_X4 
)
inlineprotectedvirtual

Store vertex attributes into the appropriate TMP_MeshInfo.

Parameters
i
index_X4

Definition at line 4977 of file TMP_Text.cs.

◆ FillSpriteVertexBuffers()

virtual void TMPro.TMP_Text.FillSpriteVertexBuffers ( int  i,
int  index_X4 
)
inlineprotectedvirtual

Fill Vertex Buffers for Sprites

Parameters
i
spriteIndex_X4

Definition at line 5112 of file TMP_Text.cs.

◆ ForceMeshUpdate() [1/2]

virtual void TMPro.TMP_Text.ForceMeshUpdate ( )
inlinevirtual

Function to force the regeneration of the text object.

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1555 of file TMP_Text.cs.

◆ ForceMeshUpdate() [2/2]

virtual void TMPro.TMP_Text.ForceMeshUpdate ( bool  ignoreActiveState)
inlinevirtual

Method used for resetting vertex layout when switching to and from Volumetric Text mode.

Parameters
updateMesh

Function to force the regeneration of the text object.

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

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1569 of file TMP_Text.cs.

◆ GenerateTextMesh()

virtual void TMPro.TMP_Text.GenerateTextMesh ( )
inlineprotectedvirtual

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

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 3404 of file TMP_Text.cs.

◆ GetAttributeParameters()

int TMPro.TMP_Text.GetAttributeParameters ( char []  chars,
int  startIndex,
int  length,
ref float []  parameters 
)
inlineprivate

Method which returns the number of parameters used in a tag attribute and populates an array with such values.

Parameters
charsChar[] containing the tag attribute and data
startIndexThe index of the first char of the data
lengthThe length of the data
parametersThe number of parameters contained in the Char[]
Returns

Definition at line 5868 of file TMP_Text.cs.

◆ GetCompoundBounds()

virtual Bounds TMPro.TMP_Text.GetCompoundBounds ( )
inlineprotectedvirtual

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

Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 4424 of file TMP_Text.cs.

◆ GetFontAssetForWeight()

TMP_FontAsset TMPro.TMP_Text.GetFontAssetForWeight ( int  fontWeight)
inlineprotected

Returns
Returns

Definition at line 5488 of file TMP_Text.cs.

◆ GetMaterial()

virtual Material TMPro.TMP_Text.GetMaterial ( Material  mat)
inlineprotectedvirtual

Function called internally when a new material is assigned via the fontMaterial property.

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1427 of file TMP_Text.cs.

◆ GetMaterials()

virtual Material [] TMPro.TMP_Text.GetMaterials ( Material []  mats)
inlineprotectedvirtual

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

Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1450 of file TMP_Text.cs.

◆ GetPaddingForMaterial() [1/2]

virtual float TMPro.TMP_Text.GetPaddingForMaterial ( )
inlineprotectedvirtual

Get the padding value for the currently assigned material

Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1533 of file TMP_Text.cs.

◆ GetPaddingForMaterial() [2/2]

virtual float TMPro.TMP_Text.GetPaddingForMaterial ( Material  mat)
inlineprotectedvirtual

Get the padding value for the given material

Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1540 of file TMP_Text.cs.

◆ GetParsedText()

virtual string TMPro.TMP_Text.GetParsedText ( )
inlinevirtual

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

Returns

Definition at line 5534 of file TMP_Text.cs.

◆ GetPreferredHeight() [1/2]

float TMPro.TMP_Text.GetPreferredHeight ( )
inlineprotected

Method to calculate the preferred height of a text object.

Returns

Definition at line 3563 of file TMP_Text.cs.

◆ GetPreferredHeight() [2/2]

float TMPro.TMP_Text.GetPreferredHeight ( Vector2  margin)
inlineprotected

Method to calculate the preferred height of a text object.

Parameters
margin
Returns

Definition at line 3598 of file TMP_Text.cs.

◆ GetPreferredValues() [1/4]

Vector2 TMPro.TMP_Text.GetPreferredValues ( )
inline

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

Returns

Definition at line 3411 of file TMP_Text.cs.

◆ GetPreferredValues() [2/4]

Vector2 TMPro.TMP_Text.GetPreferredValues ( float  width,
float  height 
)
inline

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

Returns

Definition at line 3433 of file TMP_Text.cs.

◆ GetPreferredValues() [3/4]

Vector2 TMPro.TMP_Text.GetPreferredValues ( string  text)
inline

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

Parameters
text
Returns

Definition at line 3458 of file TMP_Text.cs.

◆ GetPreferredValues() [4/4]

Vector2 TMPro.TMP_Text.GetPreferredValues ( string  text,
float  width,
float  height 
)
inline

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

Parameters
text
Returns

Definition at line 3482 of file TMP_Text.cs.

◆ GetPreferredWidth() [1/2]

float TMPro.TMP_Text.GetPreferredWidth ( )
inlineprotected

Method to calculate the preferred width of a text object.

Returns

Definition at line 3505 of file TMP_Text.cs.

◆ GetPreferredWidth() [2/2]

float TMPro.TMP_Text.GetPreferredWidth ( Vector2  margin)
inlineprotected

Method to calculate the preferred width of a text object.

Parameters
margin
Returns

Definition at line 3541 of file TMP_Text.cs.

◆ GetRenderedHeight() [1/2]

float TMPro.TMP_Text.GetRenderedHeight ( )
inlineprotected

Method returning the rendered height of the text object.

Returns

Definition at line 3658 of file TMP_Text.cs.

◆ GetRenderedHeight() [2/2]

float TMPro.TMP_Text.GetRenderedHeight ( bool  onlyVisibleCharacters)
inlineprotected

Method returning the rendered height of the text object.

Returns

Definition at line 3667 of file TMP_Text.cs.

◆ GetRenderedValues() [1/2]

Vector2 TMPro.TMP_Text.GetRenderedValues ( )
inline

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

Returns

Definition at line 3620 of file TMP_Text.cs.

◆ GetRenderedValues() [2/2]

Vector2 TMPro.TMP_Text.GetRenderedValues ( bool  onlyVisibleCharacters)
inline

Parameters
onlyVisibleCharactersShould returned value only factor in visible characters and exclude those greater than maxVisibleCharacters for instance.
Returns

Definition at line 3630 of file TMP_Text.cs.

◆ GetRenderedWidth() [1/2]

float TMPro.TMP_Text.GetRenderedWidth ( )
inlineprotected

Method returning the rendered width of the text object.

Returns

Definition at line 3640 of file TMP_Text.cs.

◆ GetRenderedWidth() [2/2]

float TMPro.TMP_Text.GetRenderedWidth ( bool  onlyVisibleCharacters)
inlineprotected

Method returning the rendered width of the text object.

Returns

Definition at line 3649 of file TMP_Text.cs.

◆ GetSharedMaterials()

virtual Material [] TMPro.TMP_Text.GetSharedMaterials ( )
inlineprotectedvirtual

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

Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1439 of file TMP_Text.cs.

◆ GetSpecialCharacters()

void TMPro.TMP_Text.GetSpecialCharacters ( TMP_FontAsset  fontAsset)
inlineprotected

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

Definition at line 5434 of file TMP_Text.cs.

◆ GetTagHashCode() [1/4]

int TMPro.TMP_Text.GetTagHashCode ( ref string  text,
int  index,
out int  closeIndex 
)
inlineprivate

Get Hashcode for a given tag.

Parameters
text
index
closeIndex
Returns

Definition at line 3210 of file TMP_Text.cs.

◆ GetTagHashCode() [2/4]

int TMPro.TMP_Text.GetTagHashCode ( ref char []  text,
int  index,
out int  closeIndex 
)
inlineprivate

Get Hashcode for a given tag.

Parameters
text
index
closeIndex
Returns

Definition at line 3236 of file TMP_Text.cs.

◆ GetTagHashCode() [3/4]

int TMPro.TMP_Text.GetTagHashCode ( ref int []  text,
int  index,
out int  closeIndex 
)
inlineprivate

Get Hashcode for a given tag.

Parameters
text
index
closeIndex
Returns

Definition at line 3262 of file TMP_Text.cs.

◆ GetTagHashCode() [4/4]

int TMPro.TMP_Text.GetTagHashCode ( ref StringBuilder  text,
int  index,
out int  closeIndex 
)
inlineprivate

Get Hashcode for a given tag.

Parameters
text
index
closeIndex
Returns

Definition at line 3288 of file TMP_Text.cs.

◆ GetTextBounds() [1/2]

Bounds TMPro.TMP_Text.GetTextBounds ( )
inlineprotected

Method which returns the bounds of the text object;

Returns

Definition at line 4431 of file TMP_Text.cs.

◆ GetTextBounds() [2/2]

Bounds TMPro.TMP_Text.GetTextBounds ( bool  onlyVisibleCharacters)
inlineprotected

Method which returns the bounds of the text object;

Parameters
onlyVisibleCharacters
Returns

Definition at line 4463 of file TMP_Text.cs.

◆ GetTextContainerLocalCorners()

virtual Vector3 [] TMPro.TMP_Text.GetTextContainerLocalCorners ( )
inlineprotectedvirtual

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

Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1547 of file TMP_Text.cs.

◆ GetTextInfo()

virtual TMP_TextInfo TMPro.TMP_Text.GetTextInfo ( string  text)
inlinevirtual

Function used to evaluate the length of a text string.

Parameters
text
Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 4538 of file TMP_Text.cs.

◆ GetUTF16() [1/2]

int TMPro.TMP_Text.GetUTF16 ( string  text,
int  i 
)
inlineprotected

Convert UTF-16 Hex to Char

Returns
The Unicode hex.
Parameters
iThe index.

Definition at line 5683 of file TMP_Text.cs.

◆ GetUTF16() [2/2]

int TMPro.TMP_Text.GetUTF16 ( StringBuilder  text,
int  i 
)
inlineprotected

Convert UTF-16 Hex to Char

Returns
The Unicode hex.
Parameters
iThe index.

Definition at line 5698 of file TMP_Text.cs.

◆ GetUTF32() [1/2]

int TMPro.TMP_Text.GetUTF32 ( string  text,
int  i 
)
inlineprotected

Convert UTF-32 Hex to Char

Returns
The Unicode hex.
Parameters
iThe index.

Definition at line 5714 of file TMP_Text.cs.

◆ GetUTF32() [2/2]

int TMPro.TMP_Text.GetUTF32 ( StringBuilder  text,
int  i 
)
inlineprotected

Convert UTF-32 Hex to Char

Returns
The Unicode hex.
Parameters
iThe index.

Definition at line 5733 of file TMP_Text.cs.

◆ HexCharsToColor() [1/2]

Color32 TMPro.TMP_Text.HexCharsToColor ( char []  hexChars,
int  tagCount 
)
inlineprotected

Method to convert Hex color values to Color32

Parameters
hexChars
tagCount
Returns

Definition at line 5754 of file TMP_Text.cs.

◆ HexCharsToColor() [2/2]

Color32 TMPro.TMP_Text.HexCharsToColor ( char []  hexChars,
int  startIndex,
int  length 
)
inlineprotected

Method to convert Hex Color values to Color32

Parameters
hexChars
startIndex
length
Returns

Definition at line 5836 of file TMP_Text.cs.

◆ HexToInt()

int TMPro.TMP_Text.HexToInt ( char  hex)
inlineprotected

Function to pack scale information in the UV2 Channel.

Parameters
x
y
scale
Returns
Parameters
x
y
Returns

Method to convert Hex to Int

Parameters
hex
Returns

Definition at line 5647 of file TMP_Text.cs.

◆ InternalCrossFadeAlpha()

virtual void TMPro.TMP_Text.InternalCrossFadeAlpha ( float  alpha,
float  duration,
bool  ignoreTimeScale 
)
inlineprotectedvirtual

Parameters
alpha
duration
ignoreTimeScale

Reimplemented in TMPro.TextMeshProUGUI.

Definition at line 1674 of file TMP_Text.cs.

◆ InternalCrossFadeColor()

virtual void TMPro.TMP_Text.InternalCrossFadeColor ( Color  targetColor,
float  duration,
bool  ignoreTimeScale,
bool  useAlpha 
)
inlineprotectedvirtual

Parameters
targetColor
duration
ignoreTimeScale
useAlpha
useRGB

Reimplemented in TMPro.TextMeshProUGUI.

Definition at line 1665 of file TMP_Text.cs.

◆ IsTagName() [1/4]

bool TMPro.TMP_Text.IsTagName ( ref string  text,
string  tag,
int  index 
)
inlineprivate

Method to check for a matching rich text tag.

Parameters
text
tag
index
Returns

Definition at line 3134 of file TMP_Text.cs.

◆ IsTagName() [2/4]

bool TMPro.TMP_Text.IsTagName ( ref char []  text,
string  tag,
int  index 
)
inlineprivate

Method to check for a matching rich text tag.

Parameters
text
tag
index
Returns

Definition at line 3153 of file TMP_Text.cs.

◆ IsTagName() [3/4]

bool TMPro.TMP_Text.IsTagName ( ref int []  text,
string  tag,
int  index 
)
inlineprivate

Method to check for a matching rich text tag.

Parameters
text
tag
index
Returns

Definition at line 3172 of file TMP_Text.cs.

◆ IsTagName() [4/4]

bool TMPro.TMP_Text.IsTagName ( ref StringBuilder  text,
string  tag,
int  index 
)
inlineprivate

Method to check for a matching rich text tag.

Parameters
text
tag
index
Returns

Definition at line 3191 of file TMP_Text.cs.

◆ LoadDefaultSettings()

void TMPro.TMP_Text.LoadDefaultSettings ( )
inlineprotected

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

Definition at line 5394 of file TMP_Text.cs.

◆ LoadFontAsset()

virtual void TMPro.TMP_Text.LoadFontAsset ( )
inlineprotectedvirtual

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

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1416 of file TMP_Text.cs.

◆ PackUV() [1/2]

Vector2 TMPro.TMP_Text.PackUV ( float  x,
float  y,
float  scale 
)
inlineprotected

Function to pack scale information in the UV2 Channel.

Parameters
x
y
scale
Returns

Function to pack scale information in the UV2 Channel.

Parameters
x
y
scale
Returns

Definition at line 5580 of file TMP_Text.cs.

◆ PackUV() [2/2]

float TMPro.TMP_Text.PackUV ( float  x,
float  y 
)
inlineprotected

Parameters
x
y
Returns

Definition at line 5600 of file TMP_Text.cs.

◆ ParseInputText()

void TMPro.TMP_Text.ParseInputText ( )
inlineprotected

Method to parse the input text based on its source

Definition at line 1680 of file TMP_Text.cs.

◆ ReplaceClosingStyleTag() [1/4]

bool TMPro.TMP_Text.ReplaceClosingStyleTag ( ref string  sourceText,
int  srcIndex,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by closing style definition.

Parameters
sourceText
srcIndex
charBuffer
writeIndex
Returns

Definition at line 2860 of file TMP_Text.cs.

◆ ReplaceClosingStyleTag() [2/4]

bool TMPro.TMP_Text.ReplaceClosingStyleTag ( ref int []  sourceText,
int  srcIndex,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by closing style definition.

Parameters
sourceText
srcIndex
charBuffer
writeIndex
Returns

Definition at line 2929 of file TMP_Text.cs.

◆ ReplaceClosingStyleTag() [3/4]

bool TMPro.TMP_Text.ReplaceClosingStyleTag ( ref char []  sourceText,
int  srcIndex,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by closing style definition.

Parameters
sourceText
srcIndex
charBuffer
writeIndex
Returns

Definition at line 2998 of file TMP_Text.cs.

◆ ReplaceClosingStyleTag() [4/4]

bool TMPro.TMP_Text.ReplaceClosingStyleTag ( ref StringBuilder  sourceText,
int  srcIndex,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by closing style definition.

Parameters
sourceText
srcIndex
charBuffer
writeIndex
Returns

Definition at line 3066 of file TMP_Text.cs.

◆ ReplaceOpeningStyleTag() [1/4]

bool TMPro.TMP_Text.ReplaceOpeningStyleTag ( ref string  sourceText,
int  srcIndex,
out int  srcOffset,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by opening style definition.

Parameters
sourceText
srcIndex
srcOffset
charBuffer
writeIndex
Returns

Definition at line 2577 of file TMP_Text.cs.

◆ ReplaceOpeningStyleTag() [2/4]

bool TMPro.TMP_Text.ReplaceOpeningStyleTag ( ref int []  sourceText,
int  srcIndex,
out int  srcOffset,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by opening style definition.

Parameters
sourceText
srcIndex
srcOffset
charBuffer
writeIndex
Returns

Definition at line 2648 of file TMP_Text.cs.

◆ ReplaceOpeningStyleTag() [3/4]

bool TMPro.TMP_Text.ReplaceOpeningStyleTag ( ref char []  sourceText,
int  srcIndex,
out int  srcOffset,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by opening style definition.

Parameters
sourceText
srcIndex
srcOffset
charBuffer
writeIndex
Returns

Definition at line 2719 of file TMP_Text.cs.

◆ ReplaceOpeningStyleTag() [4/4]

bool TMPro.TMP_Text.ReplaceOpeningStyleTag ( ref StringBuilder  sourceText,
int  srcIndex,
out int  srcOffset,
ref int []  charBuffer,
ref int  writeIndex 
)
inlineprivate

Method to handle inline replacement of style tag by opening style definition.

Parameters
sourceText
srcIndex
srcOffset
charBuffer
writeIndex
Returns

Definition at line 2790 of file TMP_Text.cs.

◆ ReplaceTagWithCharacter()

void TMPro.TMP_Text.ReplaceTagWithCharacter ( int []  chars,
int  insertionIndex,
int  tagLength,
char  c 
)
inlineprotected

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

Parameters
charsArray which contains the text.
insertionIndexThe index of where the new character will be inserted
tagLengthLength of the tag being replaced.
cThe replacement character.

Definition at line 5459 of file TMP_Text.cs.

◆ ResizeInternalArray< T >()

void TMPro.TMP_Text.ResizeInternalArray< T > ( ref T []  array)
inlineprivate

Definition at line 3310 of file TMP_Text.cs.

◆ ResizeLineExtents()

void TMPro.TMP_Text.ResizeLineExtents ( int  size)
inlineprotected

Function to increase the size of the Line Extents Array.

Parameters
size

Definition at line 4505 of file TMP_Text.cs.

◆ RestoreWordWrappingState()

int TMPro.TMP_Text.RestoreWordWrappingState ( ref WordWrapState  state)
inlineprotected

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

Parameters
state
Returns

Definition at line 4682 of file TMP_Text.cs.

◆ SaveGlyphVertexInfo()

virtual void TMPro.TMP_Text.SaveGlyphVertexInfo ( float  padding,
float  style_padding,
Color32  vertexColor 
)
inlineprotectedvirtual

Store vertex information for each character.

Parameters
style_paddingStyle_padding.
vertexColorVertex color.

Definition at line 4763 of file TMP_Text.cs.

◆ SaveSpriteVertexInfo()

virtual void TMPro.TMP_Text.SaveSpriteVertexInfo ( Color32  vertexColor)
inlineprotectedvirtual

Store vertex information for each sprite.

Parameters
padding
style_padding
vertexColor

Definition at line 4886 of file TMP_Text.cs.

◆ SaveWordWrappingState()

void TMPro.TMP_Text.SaveWordWrappingState ( ref WordWrapState  state,
int  index,
int  count 
)
inlineprotected

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

Parameters
chars
Returns

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

Parameters
state
index
count

Definition at line 4604 of file TMP_Text.cs.

◆ SetActiveSubMeshes()

virtual void TMPro.TMP_Text.SetActiveSubMeshes ( bool  state)
inlineprotectedvirtual

Method to Enable or Disable child SubMesh objects.

Parameters
state

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 5509 of file TMP_Text.cs.

◆ SetArraySizes()

virtual int TMPro.TMP_Text.SetArraySizes ( int []  chars)
inlineprotectedvirtual

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

Parameters
chars
Returns

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 3398 of file TMP_Text.cs.

◆ SetCharArray() [1/3]

void TMPro.TMP_Text.SetCharArray ( char []  sourceText)
inline

Character array containing the text to be displayed.

Parameters
sourceText

Definition at line 1882 of file TMP_Text.cs.

◆ SetCharArray() [2/3]

void TMPro.TMP_Text.SetCharArray ( char []  sourceText,
int  start,
int  length 
)
inline

Character array containing the text to be displayed.

Parameters
sourceText

Definition at line 1986 of file TMP_Text.cs.

◆ SetCharArray() [3/3]

void TMPro.TMP_Text.SetCharArray ( int []  sourceText,
int  start,
int  length 
)
inline

Character array containing the text to be displayed.

Parameters
sourceText

Definition at line 2099 of file TMP_Text.cs.

◆ SetCulling()

virtual void TMPro.TMP_Text.SetCulling ( )
inlineprotectedvirtual

Set the culling mode on the material.

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1527 of file TMP_Text.cs.

◆ SetFaceColor()

virtual void TMPro.TMP_Text.SetFaceColor ( Color32  color)
inlineprotectedvirtual

Function called internally to set the face color of the material. This will results in an instance of the material.

Parameters
color

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1505 of file TMP_Text.cs.

◆ SetFontBaseMaterial()

virtual void TMPro.TMP_Text.SetFontBaseMaterial ( Material  mat)
inlineprotectedvirtual

Function called internally when assigning a new base material.

Parameters
mat

Definition at line 1433 of file TMP_Text.cs.

◆ SetOutlineColor()

virtual void TMPro.TMP_Text.SetOutlineColor ( Color32  color)
inlineprotectedvirtual

Function called internally to set the outline color of the material. This will results in an instance of the material.

Parameters
color

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1511 of file TMP_Text.cs.

◆ SetOutlineThickness()

virtual void TMPro.TMP_Text.SetOutlineThickness ( float  thickness)
inlineprotectedvirtual

Function called internally to set the outline thickness property of the material. This will results in an instance of the material.

Parameters
thickness

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1517 of file TMP_Text.cs.

◆ SetShaderDepth()

virtual void TMPro.TMP_Text.SetShaderDepth ( )
inlineprotectedvirtual

Set the Render Queue and ZTest mode on the current material

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1522 of file TMP_Text.cs.

◆ SetSharedMaterial()

virtual void TMPro.TMP_Text.SetSharedMaterial ( Material  mat)
inlineprotectedvirtual

Function called internally when a new shared material is assigned via the fontSharedMaterial property.

Parameters
mat

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1422 of file TMP_Text.cs.

◆ SetSharedMaterials()

virtual void TMPro.TMP_Text.SetSharedMaterials ( Material []  materials)
inlineprotectedvirtual

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1444 of file TMP_Text.cs.

◆ SetText() [1/6]

void TMPro.TMP_Text.SetText ( string  text)
inline

Parameters
text

Definition at line 1709 of file TMP_Text.cs.

◆ SetText() [2/6]

void TMPro.TMP_Text.SetText ( string  text,
bool  syncTextInputBox 
)
inline

Parameters
text

Definition at line 1719 of file TMP_Text.cs.

◆ SetText() [3/6]

void TMPro.TMP_Text.SetText ( string  text,
float  arg0 
)
inline

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

ex. TextMeshPro.SetText ("Number is {0:1}.", 5.56f);

Template Parameters
T
Parameters
textString containing the pattern."</param> <param name="arg0">Value is a float.

Definition at line 1752 of file TMP_Text.cs.

◆ SetText() [4/6]

void TMPro.TMP_Text.SetText ( string  text,
float  arg0,
float  arg1 
)
inline

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

ex. TextMeshPro.SetText ("First number is {0} and second is {1:2}.", 10, 5.756f);

Template Parameters
T
Parameters
textString containing the pattern."</param> <param name="arg0">Value is a float.</param> <param name="arg1">Value is a float.

Definition at line 1765 of file TMP_Text.cs.

◆ SetText() [5/6]

void TMPro.TMP_Text.SetText ( string  text,
float  arg0,
float  arg1,
float  arg2 
)
inline

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

ex. TextMeshPro.SetText ("A = {0}, B = {1} and C = {2}.", 2, 5, 7);

Template Parameters
T
Parameters
textString containing the pattern."</param> <param name="arg0">Value is a float.</param> <param name="arg1">Value is a float.</param> <param name="arg2">Value is a float.

Definition at line 1779 of file TMP_Text.cs.

◆ SetText() [6/6]

void TMPro.TMP_Text.SetText ( StringBuilder  text)
inline

Set the text using a StringBuilder.

Using a StringBuilder instead of concatenating strings prevents memory pollution with temporary objects.

Parameters
textStringBuilder with text to display.

Definition at line 1858 of file TMP_Text.cs.

◆ SetTextArrayToCharArray()

void TMPro.TMP_Text.SetTextArrayToCharArray ( char []  sourceText,
ref int []  charBuffer 
)
inlineprotected

Copies Content of formatted SetText() to charBuffer.

Parameters
sourceText
charBuffer

Definition at line 2211 of file TMP_Text.cs.

◆ SetTextInternal()

internal void TMPro.TMP_Text.SetTextInternal ( string  text)
inlineprivate

Internal function used by the Text Input Field to populate TMP_TextInfo data.

Definition at line 1575 of file TMP_Text.cs.

◆ SetTextSortingOrder() [1/2]

void TMPro.TMP_Text.SetTextSortingOrder ( VertexSortingOrder  order)
inlineprotected

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

Definition at line 1487 of file TMP_Text.cs.

◆ SetTextSortingOrder() [2/2]

void TMPro.TMP_Text.SetTextSortingOrder ( int []  order)
inlineprotected

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

Parameters
order

Definition at line 1496 of file TMP_Text.cs.

◆ SetVertices()

virtual void TMPro.TMP_Text.SetVertices ( Vector3 []  vertices)
inlinevirtual

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

Parameters
vertices

Definition at line 1615 of file TMP_Text.cs.

◆ StringBuilderToIntArray()

void TMPro.TMP_Text.StringBuilderToIntArray ( StringBuilder  sourceText,
ref int []  charBuffer 
)
inlineprotected

Copy contents of StringBuilder into int array.

Parameters
sourceTextText to copy.
charBufferArray to store contents.

Definition at line 2431 of file TMP_Text.cs.

◆ StringToCharArray()

void TMPro.TMP_Text.StringToCharArray ( string  sourceText,
ref int []  charBuffer 
)
inlineprotected

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

Parameters
sourceText
charBuffer

Definition at line 2286 of file TMP_Text.cs.

◆ UpdateGeometry()

virtual void TMPro.TMP_Text.UpdateGeometry ( Mesh  mesh,
int  index 
)
inlinevirtual

Function to force the regeneration of the text object.

Parameters
flagsFlags to control which portions of the geometry gets uploaded.

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

Parameters
mesh
index

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1596 of file TMP_Text.cs.

◆ UpdateMeshPadding()

virtual void TMPro.TMP_Text.UpdateMeshPadding ( )
inlinevirtual

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

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1621 of file TMP_Text.cs.

◆ UpdateVertexData() [1/2]

virtual void TMPro.TMP_Text.UpdateVertexData ( TMP_VertexDataUpdateFlags  flags)
inlinevirtual

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

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1602 of file TMP_Text.cs.

◆ UpdateVertexData() [2/2]

virtual void TMPro.TMP_Text.UpdateVertexData ( )
inlinevirtual

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

Reimplemented in TMPro.TextMeshProUGUI, and TMPro.TextMeshPro.

Definition at line 1608 of file TMP_Text.cs.

◆ ValidateHtmlTag()

bool TMPro.TMP_Text.ValidateHtmlTag ( int []  chars,
int  startIndex,
out int  endIndex 
)
inlineprotected

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

Parameters
chars
startIndex
endIndex
Returns

Definition at line 5979 of file TMP_Text.cs.

Property Documentation

◆ alignment

TextAlignmentOptions TMPro.TMP_Text.alignment
getset

Text alignment options

Definition at line 507 of file TMP_Text.cs.

◆ alpha

float TMPro.TMP_Text.alpha
getset

Sets the vertex color alpha value.

Definition at line 247 of file TMP_Text.cs.

◆ autoSizeTextContainer

virtual bool TMPro.TMP_Text.autoSizeTextContainer
getset

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

Definition at line 1078 of file TMP_Text.cs.

◆ bounds

Bounds TMPro.TMP_Text.bounds
get

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

Definition at line 1110 of file TMP_Text.cs.

◆ characterSpacing

float TMPro.TMP_Text.characterSpacing
getset

Use the extents of the text geometry for alignment instead of font metrics.

The amount of additional spacing between characters.

Definition at line 536 of file TMP_Text.cs.

◆ characterWidthAdjustment

float TMPro.TMP_Text.characterWidthAdjustment
getset

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

Definition at line 598 of file TMP_Text.cs.

◆ color

override Color TMPro.TMP_Text.color
getset

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

Definition at line 228 of file TMP_Text.cs.

◆ colorGradient

VertexGradient TMPro.TMP_Text.colorGradient
getset

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

The color gradient.

Definition at line 273 of file TMP_Text.cs.

◆ colorGradientPreset

TMP_ColorGradient TMPro.TMP_Text.colorGradientPreset
getset

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

Definition at line 285 of file TMP_Text.cs.

◆ enableAutoSizing

bool TMPro.TMP_Text.enableAutoSizing
getset

Enable text auto-sizing

Definition at line 449 of file TMP_Text.cs.

◆ enableCulling

bool TMPro.TMP_Text.enableCulling
getset

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

Definition at line 822 of file TMP_Text.cs.

◆ enableKerning

bool TMPro.TMP_Text.enableKerning
getset

Determines if kerning is enabled or disabled.

Definition at line 749 of file TMP_Text.cs.

◆ enableVertexGradient

bool TMPro.TMP_Text.enableVertexGradient
getset

Determines if Vertex Color Gradient should be used

true if enable vertex gradient; otherwise, false.

Definition at line 258 of file TMP_Text.cs.

◆ enableWordWrapping

bool TMPro.TMP_Text.enableWordWrapping
getset

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

Definition at line 611 of file TMP_Text.cs.

◆ extraPadding

bool TMPro.TMP_Text.extraPadding
getset

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

Definition at line 761 of file TMP_Text.cs.

◆ faceColor

Color32 TMPro.TMP_Text.faceColor
getset

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

Definition at line 335 of file TMP_Text.cs.

◆ firstOverflowCharacterIndex

int TMPro.TMP_Text.firstOverflowCharacterIndex
get

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

Definition at line 671 of file TMP_Text.cs.

◆ firstVisibleCharacter

int TMPro.TMP_Text.firstVisibleCharacter
getset

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

Definition at line 929 of file TMP_Text.cs.

◆ flexibleHeight

float TMPro.TMP_Text.flexibleHeight
get

Definition at line 1214 of file TMP_Text.cs.

◆ flexibleWidth

float TMPro.TMP_Text.flexibleWidth
get

Definition at line 1220 of file TMP_Text.cs.

◆ font

TMP_FontAsset TMPro.TMP_Text.font
getset

The Font Asset to be assigned to this text object.

Definition at line 141 of file TMP_Text.cs.

◆ fontMaterial

Material TMPro.TMP_Text.fontMaterial
getset

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

Definition at line 186 of file TMP_Text.cs.

◆ fontMaterials

virtual Material [] TMPro.TMP_Text.fontMaterials
getset

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

Definition at line 213 of file TMP_Text.cs.

◆ fontScale

float TMPro.TMP_Text.fontScale
get

The scale of the current text.

Definition at line 406 of file TMP_Text.cs.

◆ fontSharedMaterial

virtual Material TMPro.TMP_Text.fontSharedMaterial
getset

The material to be assigned to this text object.

Definition at line 155 of file TMP_Text.cs.

◆ fontSharedMaterials

virtual Material [] TMPro.TMP_Text.fontSharedMaterials
getset

An array containing the materials used by the text object.

Definition at line 174 of file TMP_Text.cs.

◆ fontSize

float TMPro.TMP_Text.fontSize
getset

The point size of the font.

Definition at line 390 of file TMP_Text.cs.

◆ fontSizeMax

float TMPro.TMP_Text.fontSizeMax
getset

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

Definition at line 475 of file TMP_Text.cs.

◆ fontSizeMin

float TMPro.TMP_Text.fontSizeMin
getset

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

Definition at line 463 of file TMP_Text.cs.

◆ fontStyle

FontStyles TMPro.TMP_Text.fontStyle
getset

The style of the text

Definition at line 487 of file TMP_Text.cs.

◆ fontWeight

int TMPro.TMP_Text.fontWeight
getset

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

Definition at line 415 of file TMP_Text.cs.

◆ geometrySortingOrder

VertexSortingOrder TMPro.TMP_Text.geometrySortingOrder
getset

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

Definition at line 916 of file TMP_Text.cs.

◆ havePropertiesChanged

bool TMPro.TMP_Text.havePropertiesChanged
getset

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

Definition at line 1024 of file TMP_Text.cs.

◆ horizontalMapping

TextureMappingOptions TMPro.TMP_Text.horizontalMapping
getset

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

Definition at line 857 of file TMP_Text.cs.

◆ ignoreRectMaskCulling

bool TMPro.TMP_Text.ignoreRectMaskCulling
getset

Controls whether or not the text object will be culled when using a 2D Rect Mask.

Definition at line 833 of file TMP_Text.cs.

◆ ignoreVisibility

bool TMPro.TMP_Text.ignoreVisibility
getset

Forces objects that are not visible to get refreshed.

Definition at line 845 of file TMP_Text.cs.

◆ isLinkedTextComponent

bool TMPro.TMP_Text.isLinkedTextComponent
getset

Indicates whether this text component is linked to another.

Definition at line 717 of file TMP_Text.cs.

◆ isOrthographic

bool TMPro.TMP_Text.isOrthographic
getset

Sets Perspective Correction to Zero for Orthographic Camera mode & 0.875f for Perspective Camera mode.

Definition at line 810 of file TMP_Text.cs.

◆ isOverlay

bool TMPro.TMP_Text.isOverlay
getset

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

Definition at line 799 of file TMP_Text.cs.

◆ isRightToLeftText

bool TMPro.TMP_Text.isRightToLeftText
getset

Definition at line 129 of file TMP_Text.cs.

◆ isTextOverflowing

bool TMPro.TMP_Text.isTextOverflowing
get

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

Definition at line 662 of file TMP_Text.cs.

◆ isTextTruncated

bool TMPro.TMP_Text.isTextTruncated
get

Property indicating whether the text is Truncated or using Ellipsis.

Definition at line 740 of file TMP_Text.cs.

◆ isUsingBold

bool TMPro.TMP_Text.isUsingBold
get

Property used in conjunction with padding calculation for the geometry.

Definition at line 499 of file TMP_Text.cs.

◆ isUsingLegacyAnimationComponent

bool TMPro.TMP_Text.isUsingLegacyAnimationComponent
getset

Property to handle legacy animation component.

Definition at line 1036 of file TMP_Text.cs.

◆ isVolumetricText

bool TMPro.TMP_Text.isVolumetricText
getset

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

Definition at line 1099 of file TMP_Text.cs.

◆ layoutElement

LayoutElement TMPro.TMP_Text.layoutElement
getprotected

Definition at line 1251 of file TMP_Text.cs.

◆ layoutPriority

int TMPro.TMP_Text.layoutPriority
get

Definition at line 1298 of file TMP_Text.cs.

◆ lineSpacing

float TMPro.TMP_Text.lineSpacing
getset

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

Definition at line 560 of file TMP_Text.cs.

◆ lineSpacingAdjustment

float TMPro.TMP_Text.lineSpacingAdjustment
getset

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

Definition at line 574 of file TMP_Text.cs.

◆ linkedTextComponent

TMP_Text TMPro.TMP_Text.linkedTextComponent
getset

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

Definition at line 682 of file TMP_Text.cs.

◆ mappingUvLineOffset

float TMPro.TMP_Text.mappingUvLineOffset
getset

Controls the UV Offset for the various texture mapping mode on the text object.

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

Definition at line 893 of file TMP_Text.cs.

◆ margin

virtual Vector4 TMPro.TMP_Text.margin
getset

The margins of the text object.

Definition at line 997 of file TMP_Text.cs.

◆ maxHeight

float TMPro.TMP_Text.maxHeight
get

Definition at line 1244 of file TMP_Text.cs.

◆ maxVisibleCharacters

int TMPro.TMP_Text.maxVisibleCharacters
getset

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

Definition at line 940 of file TMP_Text.cs.

◆ maxVisibleLines

int TMPro.TMP_Text.maxVisibleLines
getset

Allows control over how many lines of text are displayed.

Definition at line 962 of file TMP_Text.cs.

◆ maxVisibleWords

int TMPro.TMP_Text.maxVisibleWords
getset

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

Definition at line 951 of file TMP_Text.cs.

◆ maxWidth

float TMPro.TMP_Text.maxWidth
get

Definition at line 1238 of file TMP_Text.cs.

◆ mesh

virtual Mesh TMPro.TMP_Text.mesh
get

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

Definition at line 1089 of file TMP_Text.cs.

◆ minHeight

float TMPro.TMP_Text.minHeight
get

Definition at line 1232 of file TMP_Text.cs.

◆ minWidth

float TMPro.TMP_Text.minWidth
get

Definition at line 1226 of file TMP_Text.cs.

◆ outlineColor

Color32 TMPro.TMP_Text.outlineColor
getset

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

Definition at line 354 of file TMP_Text.cs.

◆ outlineWidth

float TMPro.TMP_Text.outlineWidth
getset

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

Definition at line 373 of file TMP_Text.cs.

◆ overflowMode

TextOverflowModes TMPro.TMP_Text.overflowMode
getset

Controls the Text Overflow Mode

Definition at line 650 of file TMP_Text.cs.

◆ overrideColorTags

bool TMPro.TMP_Text.overrideColorTags
getset

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

Definition at line 323 of file TMP_Text.cs.

◆ pageToDisplay

int TMPro.TMP_Text.pageToDisplay
getset

Controls which page of text is shown

Definition at line 985 of file TMP_Text.cs.

◆ paragraphSpacing

float TMPro.TMP_Text.paragraphSpacing
getset

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

Definition at line 586 of file TMP_Text.cs.

◆ parseCtrlCharacters

bool TMPro.TMP_Text.parseCtrlCharacters
getset

Enables or Disables parsing of CTRL characters in input text.

Definition at line 787 of file TMP_Text.cs.

◆ pixelsPerUnit

float TMPro.TMP_Text.pixelsPerUnit
get

Definition at line 428 of file TMP_Text.cs.

◆ preferredHeight

virtual float TMPro.TMP_Text.preferredHeight
get

Computed preferred height of the text object.

Definition at line 1275 of file TMP_Text.cs.

◆ preferredWidth

virtual float TMPro.TMP_Text.preferredWidth
get

Computed preferred width of the text object.

Definition at line 1267 of file TMP_Text.cs.

◆ rectTransform

new RectTransform TMPro.TMP_Text.rectTransform
get

Returns are reference to the RectTransform

Definition at line 1063 of file TMP_Text.cs.

◆ renderedHeight

virtual float TMPro.TMP_Text.renderedHeight
get

Compute the rendered height of the text object.

Definition at line 1292 of file TMP_Text.cs.

◆ renderedWidth

virtual float TMPro.TMP_Text.renderedWidth
get

Compute the rendered width of the text object.

Definition at line 1286 of file TMP_Text.cs.

◆ renderMode

TextRenderFlags TMPro.TMP_Text.renderMode
getset

Determines if the Mesh will be rendered.

Definition at line 905 of file TMP_Text.cs.

◆ richText

bool TMPro.TMP_Text.richText
getset

Enables or Disables Rich Text Tags

Definition at line 775 of file TMP_Text.cs.

◆ spriteAnimator

TMP_SpriteAnimator TMPro.TMP_Text.spriteAnimator
getprotected

Component used to control wrapping of text following some arbitrary shape.

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

Definition at line 1177 of file TMP_Text.cs.

◆ spriteAsset

TMP_SpriteAsset TMPro.TMP_Text.spriteAsset
getset

Default Sprite Asset used by the text object.

Definition at line 297 of file TMP_Text.cs.

◆ text

string TMPro.TMP_Text.text
getset

A string containing the text to be displayed.

Definition at line 116 of file TMP_Text.cs.

◆ textBounds

Bounds TMPro.TMP_Text.textBounds
get

Returns the bounds of the text of the text object.

Definition at line 1123 of file TMP_Text.cs.

◆ textInfo

TMP_TextInfo TMPro.TMP_Text.textInfo
get

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

Definition at line 1014 of file TMP_Text.cs.

◆ tintAllSprites

bool TMPro.TMP_Text.tintAllSprites
getset

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

Definition at line 309 of file TMP_Text.cs.

◆ transform

new Transform TMPro.TMP_Text.transform
get

Returns are reference to the Transform

Definition at line 1048 of file TMP_Text.cs.

◆ useMaxVisibleDescender

bool TMPro.TMP_Text.useMaxVisibleDescender
getset

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

Definition at line 973 of file TMP_Text.cs.

◆ verticalMapping

TextureMappingOptions TMPro.TMP_Text.verticalMapping
getset

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

Definition at line 869 of file TMP_Text.cs.

◆ wordSpacing

float TMPro.TMP_Text.wordSpacing
getset

The amount of additional spacing between words.

Definition at line 549 of file TMP_Text.cs.

◆ wordWrappingRatios

float TMPro.TMP_Text.wordWrappingRatios
getset

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

Definition at line 625 of file TMP_Text.cs.


The documentation for this class was generated from the following file: