Hue Preserving Color Blending
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes | List of all members
TMPro.TextMeshProUGUI Class Reference
Inheritance diagram for TMPro.TextMeshProUGUI:
TMPro.TMP_Text

Public Member Functions

void CalculateLayoutInputHorizontal ()
 Function called by Unity when the horizontal layout needs to be recalculated. More...
 
void CalculateLayoutInputVertical ()
 Function called by Unity when the vertical layout needs to be recalculated. More...
 
override void SetVerticesDirty ()
 
override void SetLayoutDirty ()
 
override void SetMaterialDirty ()
 
override void SetAllDirty ()
 
override void Rebuild (CanvasUpdate update)
 
override Material GetModifiedMaterial (Material baseMaterial)
 
override void RecalculateClipping ()
 Method called when the state of a parent changes. More...
 
override void RecalculateMasking ()
 Method called when Stencil Mask needs to be updated on this element and parents. More...
 
override void Cull (Rect clipRect, bool validRect)
 Override of the Cull function to provide for the ability to override the culling of the text object. More...
 
override void UpdateMeshPadding ()
 Function to be used to force recomputing of character padding when Shader / Material properties have been changed via script. More...
 
override void ForceMeshUpdate ()
 Function to force regeneration of the mesh before its normal process time. This is useful when changes to the text object properties need to be applied immediately. More...
 
override void ForceMeshUpdate (bool ignoreInactive)
 Function to force regeneration of the mesh before its normal process time. This is useful when changes to the text object properties need to be applied immediately. More...
 
override TMP_TextInfo GetTextInfo (string text)
 Function used to evaluate the length of a text string. More...
 
override void ClearMesh ()
 Function to clear the geometry of the Primary and Sub Text objects. More...
 
override void UpdateGeometry (Mesh mesh, int index)
 Function to force the regeneration of the text object. More...
 
override void UpdateVertexData (TMP_VertexDataUpdateFlags flags)
 Function to upload the updated vertex data and renderer. More...
 
override void UpdateVertexData ()
 Function to upload the updated vertex data and renderer. More...
 
void UpdateFontAsset ()
 
override void ComputeMarginSize ()
 Update the margin width and height More...
 
- Public Member Functions inherited from TMPro.TMP_Text
virtual void SetVertices (Vector3[] vertices)
 Function to push a new set of vertices to the mesh. 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 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 Member Functions

override void UpdateMaterial ()
 
override void InternalCrossFadeColor (Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
 Tweens the CanvasRenderer color associated with this Graphic. More...
 
override void InternalCrossFadeAlpha (float alpha, float duration, bool ignoreTimeScale)
 Tweens the alpha of the CanvasRenderer color associated with this Graphic. More...
 
override void Awake ()
 
override void OnEnable ()
 
override void OnDisable ()
 
override void OnDestroy ()
 
override void LoadFontAsset ()
 Method which derived classes need to override to load Font Assets. More...
 
override Material GetMaterial (Material mat)
 Function called internally when a new material is assigned via the fontMaterial property. More...
 
override Material [] GetMaterials (Material[] mats)
 Method returning instances of the materials used by the text object. More...
 
override void SetSharedMaterial (Material mat)
 Function called internally when a new shared material is assigned via the fontSharedMaterial property. More...
 
override Material [] GetSharedMaterials ()
 Method returning an array containing the materials used by the text object. More...
 
override void SetSharedMaterials (Material[] materials)
 Method used to assign new materials to the text and sub text objects. More...
 
override 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...
 
override 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...
 
override 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...
 
override void SetShaderDepth ()
 Set the Render Queue and ZTest mode on the current material More...
 
override void SetCulling ()
 Set the culling mode on the material. More...
 
override float GetPaddingForMaterial (Material mat)
 Get the padding value for the currently assigned material. More...
 
override float GetPaddingForMaterial ()
 Get the padding value for the currently assigned material. More...
 
override int SetArraySizes (int[] chars)
 Method used to determine the number of visible characters and required buffer allocations. More...
 
override void OnDidApplyAnimationProperties ()
 
override void OnCanvasHierarchyChanged ()
 
override void OnTransformParentChanged ()
 
override void OnRectTransformDimensionsChange ()
 
override void GenerateTextMesh ()
 This is the main function that is responsible for creating / displaying the text. More...
 
override Vector3 [] GetTextContainerLocalCorners ()
 Method to return the local corners of the Text Container or RectTransform. More...
 
override void SetActiveSubMeshes (bool state)
 Method to Enable or Disable child SubMesh objects. More...
 
override Bounds GetCompoundBounds ()
 Method returning the compound bounds of the text object and child sub objects. More...
 
override 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...
 
- Protected Member Functions inherited from TMPro.TMP_Text
virtual void SetFontBaseMaterial (Material mat)
 Function called internally when assigning a new base material. 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...
 
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...
 
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...
 
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...
 
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 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

TMP_SubMeshUI [] m_subTextObjects = new TMP_SubMeshUI[8]
 
- Protected Attributes inherited from TMPro.TMP_Text
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
 

Properties

override Material materialForRendering [get]
 Get the material that will be used for rendering. More...
 
override bool autoSizeTextContainer [get, set]
 Determines if the size of the text container will be adjusted to fit the text object when it is first created. More...
 
override Mesh mesh [get]
 Reference to the Mesh used by the text object. More...
 
new CanvasRenderer canvasRenderer [get]
 Reference to the CanvasRenderer used by the text object. More...
 
Vector4 maskOffset [get, set]
 Sets the masking offset from the bounds of the object More...
 
- Properties inherited from TMPro.TMP_Text
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

void UpdateSubObjectPivot ()
 Method to keep the pivot of the sub text objects in sync with the parent pivot. More...
 
Canvas GetCanvas ()
 Method to retrieve the parent Canvas. More...
 
void UpdateEnvMapMatrix ()
 Method used when animating the Env Map on the material. More...
 
void EnableMasking ()
 
void DisableMasking ()
 
void UpdateMask ()
 
void SetPerspectiveCorrection ()
 
void SetMeshArrays (int size)
 
void LateUpdate ()
 Unity standard function used to check if the transform or scale of the text object has changed. More...
 
void OnPreRenderCanvas ()
 
void UpdateSDFScale (float lossyScale)
 Method to Update Scale in UV2 More...
 

Private Attributes

bool m_isRebuildingLayout = false
 Anchor dampening prevents the anchor position from being adjusted unless the positional change exceeds about 40% of the width of the underline character. This essentially stabilizes the anchor position. More...
 
bool m_hasFontAssetChanged = false
 
float m_previousLossyScaleY = -1
 
Vector3 [] m_RectTransformCorners = new Vector3[4]
 
CanvasRenderer m_canvasRenderer
 
Canvas m_canvas
 
bool m_isFirstAllocation
 
int m_max_characters = 8
 
bool m_isMaskingEnabled
 
Material m_baseMaterial
 
bool m_isScrollRegionSet
 
int m_stencilID = 0
 
Vector4 m_maskOffset
 
Matrix4x4 m_EnvMapMatrix = new Matrix4x4()
 
bool m_isRegisteredForEvents
 
int m_recursiveCountA = 0
 
int loopCountA = 0
 

Additional Inherited Members

- Protected Types inherited from TMPro.TMP_Text
enum  TextInputSources { Text = 0, SetText = 1, SetCharArray = 2, String = 3 }
 
- Static Protected Attributes inherited from TMPro.TMP_Text
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
 

Detailed Description

Definition at line 21 of file TextMeshProUGUI.cs.

Member Function Documentation

◆ AdjustLineOffset()

override void TMPro.TextMeshProUGUI.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 from TMPro.TMP_Text.

Definition at line 4222 of file TMPro_UGUI_Private.cs.

◆ CalculateLayoutInputHorizontal()

void TMPro.TextMeshProUGUI.CalculateLayoutInputHorizontal ( )
inline

Function called by Unity when the horizontal layout needs to be recalculated.

Definition at line 83 of file TextMeshProUGUI.cs.

◆ CalculateLayoutInputVertical()

void TMPro.TextMeshProUGUI.CalculateLayoutInputVertical ( )
inline

Function called by Unity when the vertical layout needs to be recalculated.

Definition at line 105 of file TextMeshProUGUI.cs.

◆ ClearMesh()

override void TMPro.TextMeshProUGUI.ClearMesh ( )
inlinevirtual

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

Reimplemented from TMPro.TMP_Text.

Definition at line 526 of file TextMeshProUGUI.cs.

◆ ComputeMarginSize()

override void TMPro.TextMeshProUGUI.ComputeMarginSize ( )
inlinevirtual

Update the margin width and height

Reimplemented from TMPro.TMP_Text.

Definition at line 1492 of file TMPro_UGUI_Private.cs.

◆ Cull()

override void TMPro.TextMeshProUGUI.Cull ( Rect  clipRect,
bool  validRect 
)
inline

Override of the Cull function to provide for the ability to override the culling of the text object.

Parameters
clipRect
validRect

Definition at line 356 of file TextMeshProUGUI.cs.

◆ ForceMeshUpdate() [1/2]

override void TMPro.TextMeshProUGUI.ForceMeshUpdate ( )
inlinevirtual

Function to force regeneration of the mesh before its normal process time. This is useful when changes to the text object properties need to be applied immediately.

Reimplemented from TMPro.TMP_Text.

Definition at line 478 of file TextMeshProUGUI.cs.

◆ ForceMeshUpdate() [2/2]

override void TMPro.TextMeshProUGUI.ForceMeshUpdate ( bool  ignoreInactive)
inlinevirtual

Function to force regeneration of the mesh before its normal process time. This is useful when changes to the text object properties need to be applied immediately.

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

Reimplemented from TMPro.TMP_Text.

Definition at line 491 of file TextMeshProUGUI.cs.

◆ GenerateTextMesh()

override void TMPro.TextMeshProUGUI.GenerateTextMesh ( )
inlineprotectedvirtual

This is the main function that is responsible for creating / displaying the text.

Reimplemented from TMPro.TMP_Text.

Definition at line 1651 of file TMPro_UGUI_Private.cs.

◆ GetCanvas()

Canvas TMPro.TextMeshProUGUI.GetCanvas ( )
inlineprivate

Method to retrieve the parent Canvas.

Definition at line 563 of file TMPro_UGUI_Private.cs.

◆ GetCompoundBounds()

override Bounds TMPro.TextMeshProUGUI.GetCompoundBounds ( )
inlineprotectedvirtual

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

Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 4131 of file TMPro_UGUI_Private.cs.

◆ GetMaterial()

override Material TMPro.TextMeshProUGUI.GetMaterial ( Material  mat)
inlineprotectedvirtual

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

Reimplemented from TMPro.TMP_Text.

Definition at line 736 of file TMPro_UGUI_Private.cs.

◆ GetMaterials()

override Material [] TMPro.TextMeshProUGUI.GetMaterials ( Material []  mats)
inlineprotectedvirtual

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

Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 766 of file TMPro_UGUI_Private.cs.

◆ GetModifiedMaterial()

override Material TMPro.TextMeshProUGUI.GetModifiedMaterial ( Material  baseMaterial)
inline

Parameters
baseMaterial
Returns

Definition at line 242 of file TextMeshProUGUI.cs.

◆ GetPaddingForMaterial() [1/2]

override float TMPro.TextMeshProUGUI.GetPaddingForMaterial ( Material  mat)
inlineprotectedvirtual

Get the padding value for the currently assigned material.

Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 992 of file TMPro_UGUI_Private.cs.

◆ GetPaddingForMaterial() [2/2]

override float TMPro.TextMeshProUGUI.GetPaddingForMaterial ( )
inlineprotectedvirtual

Get the padding value for the currently assigned material.

Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 1006 of file TMPro_UGUI_Private.cs.

◆ GetSharedMaterials()

override Material [] TMPro.TextMeshProUGUI.GetSharedMaterials ( )
inlineprotectedvirtual

Method returning an array containing the materials used by the text object.

Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 810 of file TMPro_UGUI_Private.cs.

◆ GetTextContainerLocalCorners()

override Vector3 [] TMPro.TextMeshProUGUI.GetTextContainerLocalCorners ( )
inlineprotectedvirtual

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

Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 4103 of file TMPro_UGUI_Private.cs.

◆ GetTextInfo()

override TMP_TextInfo TMPro.TextMeshProUGUI.GetTextInfo ( string  text)
inlinevirtual

Function used to evaluate the length of a text string.

Parameters
text
Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 504 of file TextMeshProUGUI.cs.

◆ InternalCrossFadeAlpha()

override void TMPro.TextMeshProUGUI.InternalCrossFadeAlpha ( float  alpha,
float  duration,
bool  ignoreTimeScale 
)
inlineprotectedvirtual

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

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

Reimplemented from TMPro.TMP_Text.

Definition at line 464 of file TextMeshProUGUI.cs.

◆ InternalCrossFadeColor()

override void TMPro.TextMeshProUGUI.InternalCrossFadeColor ( Color  targetColor,
float  duration,
bool  ignoreTimeScale,
bool  useAlpha 
)
inlineprotectedvirtual

Tweens the CanvasRenderer color associated with this Graphic.

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

Reimplemented from TMPro.TMP_Text.

Definition at line 447 of file TextMeshProUGUI.cs.

◆ LateUpdate()

void TMPro.TextMeshProUGUI.LateUpdate ( )
inlineprivate

Unity standard function used to check if the transform or scale of the text object has changed.

Definition at line 1559 of file TMPro_UGUI_Private.cs.

◆ LoadFontAsset()

override void TMPro.TextMeshProUGUI.LoadFontAsset ( )
inlineprotectedvirtual

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

Reimplemented from TMPro.TMP_Text.

Definition at line 501 of file TMPro_UGUI_Private.cs.

◆ OnDidApplyAnimationProperties()

override void TMPro.TextMeshProUGUI.OnDidApplyAnimationProperties ( )
inlineprotected

Definition at line 1510 of file TMPro_UGUI_Private.cs.

◆ Rebuild()

override void TMPro.TextMeshProUGUI.Rebuild ( CanvasUpdate  update)
inline

Parameters
update

Definition at line 196 of file TextMeshProUGUI.cs.

◆ RecalculateClipping()

override void TMPro.TextMeshProUGUI.RecalculateClipping ( )
inline

Method called when the state of a parent changes.

Definition at line 332 of file TextMeshProUGUI.cs.

◆ RecalculateMasking()

override void TMPro.TextMeshProUGUI.RecalculateMasking ( )
inline

Method called when Stencil Mask needs to be updated on this element and parents.

Definition at line 343 of file TextMeshProUGUI.cs.

◆ SetActiveSubMeshes()

override void TMPro.TextMeshProUGUI.SetActiveSubMeshes ( bool  state)
inlineprotectedvirtual

Method to Enable or Disable child SubMesh objects.

Parameters
state

Reimplemented from TMPro.TMP_Text.

Definition at line 4117 of file TMPro_UGUI_Private.cs.

◆ SetAllDirty()

override void TMPro.TextMeshProUGUI.SetAllDirty ( )
inline

Definition at line 181 of file TextMeshProUGUI.cs.

◆ SetArraySizes()

override int TMPro.TextMeshProUGUI.SetArraySizes ( int []  chars)
inlineprotectedvirtual

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

Parameters
chars
Returns

Reimplemented from TMPro.TMP_Text.

Definition at line 1027 of file TMPro_UGUI_Private.cs.

◆ SetCulling()

override void TMPro.TextMeshProUGUI.SetCulling ( )
inlineprotectedvirtual

Set the culling mode on the material.

Reimplemented from TMPro.TMP_Text.

Definition at line 939 of file TMPro_UGUI_Private.cs.

◆ SetFaceColor()

override void TMPro.TextMeshProUGUI.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 from TMPro.TMP_Text.

Definition at line 893 of file TMPro_UGUI_Private.cs.

◆ SetLayoutDirty()

override void TMPro.TextMeshProUGUI.SetLayoutDirty ( )
inline

Definition at line 142 of file TextMeshProUGUI.cs.

◆ SetMaterialDirty()

override void TMPro.TextMeshProUGUI.SetMaterialDirty ( )
inline

Definition at line 163 of file TextMeshProUGUI.cs.

◆ SetOutlineColor()

override void TMPro.TextMeshProUGUI.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 from TMPro.TMP_Text.

Definition at line 907 of file TMPro_UGUI_Private.cs.

◆ SetOutlineThickness()

override void TMPro.TextMeshProUGUI.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 from TMPro.TMP_Text.

Definition at line 871 of file TMPro_UGUI_Private.cs.

◆ SetShaderDepth()

override void TMPro.TextMeshProUGUI.SetShaderDepth ( )
inlineprotectedvirtual

Set the Render Queue and ZTest mode on the current material

Reimplemented from TMPro.TMP_Text.

Definition at line 921 of file TMPro_UGUI_Private.cs.

◆ SetSharedMaterial()

override void TMPro.TextMeshProUGUI.SetSharedMaterial ( Material  mat)
inlineprotectedvirtual

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

Parameters
mat

Reimplemented from TMPro.TMP_Text.

Definition at line 791 of file TMPro_UGUI_Private.cs.

◆ SetSharedMaterials()

override void TMPro.TextMeshProUGUI.SetSharedMaterials ( Material []  materials)
inlineprotectedvirtual

Method used to assign new materials to the text and sub text objects.

Reimplemented from TMPro.TMP_Text.

Definition at line 834 of file TMPro_UGUI_Private.cs.

◆ UpdateEnvMapMatrix()

void TMPro.TextMeshProUGUI.UpdateEnvMapMatrix ( )
inlineprivate

Method used when animating the Env Map on the material.

Definition at line 591 of file TMPro_UGUI_Private.cs.

◆ UpdateGeometry()

override void TMPro.TextMeshProUGUI.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 from TMPro.TMP_Text.

Definition at line 550 of file TextMeshProUGUI.cs.

◆ UpdateMaterial()

override void TMPro.TextMeshProUGUI.UpdateMaterial ( )
inlineprotected

Definition at line 272 of file TextMeshProUGUI.cs.

◆ UpdateMeshPadding()

override void TMPro.TextMeshProUGUI.UpdateMeshPadding ( )
inlinevirtual

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

Reimplemented from TMPro.TMP_Text.

Definition at line 424 of file TextMeshProUGUI.cs.

◆ UpdateSDFScale()

void TMPro.TextMeshProUGUI.UpdateSDFScale ( float  lossyScale)
inlineprivate

Method to Update Scale in UV2

Definition at line 4162 of file TMPro_UGUI_Private.cs.

◆ UpdateSubObjectPivot()

void TMPro.TextMeshProUGUI.UpdateSubObjectPivot ( )
inlineprivate

Method to keep the pivot of the sub text objects in sync with the parent pivot.

Definition at line 225 of file TextMeshProUGUI.cs.

◆ UpdateVertexData() [1/2]

override void TMPro.TextMeshProUGUI.UpdateVertexData ( TMP_VertexDataUpdateFlags  flags)
inlinevirtual

Function to upload the updated vertex data and renderer.

Reimplemented from TMPro.TMP_Text.

Definition at line 568 of file TextMeshProUGUI.cs.

◆ UpdateVertexData() [2/2]

override void TMPro.TextMeshProUGUI.UpdateVertexData ( )
inlinevirtual

Function to upload the updated vertex data and renderer.

Reimplemented from TMPro.TMP_Text.

Definition at line 615 of file TextMeshProUGUI.cs.

Member Data Documentation

◆ m_isRebuildingLayout

bool TMPro.TextMeshProUGUI.m_isRebuildingLayout = false
private

Anchor dampening prevents the anchor position from being adjusted unless the positional change exceeds about 40% of the width of the underline character. This essentially stabilizes the anchor position.

Definition at line 76 of file TextMeshProUGUI.cs.

Property Documentation

◆ autoSizeTextContainer

override bool TMPro.TextMeshProUGUI.autoSizeTextContainer
getset

Determines if the size of the text container will be adjusted to fit the text object when it is first created.

Definition at line 35 of file TextMeshProUGUI.cs.

◆ canvasRenderer

new CanvasRenderer TMPro.TextMeshProUGUI.canvasRenderer
get

Reference to the CanvasRenderer used by the text object.

Definition at line 56 of file TextMeshProUGUI.cs.

◆ maskOffset

Vector4 TMPro.TextMeshProUGUI.maskOffset
getset

Sets the masking offset from the bounds of the object

Definition at line 309 of file TextMeshProUGUI.cs.

◆ materialForRendering

override Material TMPro.TextMeshProUGUI.materialForRendering
get

Get the material that will be used for rendering.

Definition at line 27 of file TextMeshProUGUI.cs.

◆ mesh

override Mesh TMPro.TextMeshProUGUI.mesh
get

Reference to the Mesh used by the text object.

Definition at line 47 of file TextMeshProUGUI.cs.


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