Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
TMPro.TextMeshPro Class Reference
Inheritance diagram for TMPro.TextMeshPro:
TMPro.TMP_Text

Public Member Functions

void CalculateLayoutInputHorizontal ()
 
void CalculateLayoutInputVertical ()
 
override void ClearMesh (bool updateMesh)
 Function to clear the geometry of the Primary and Sub Text objects. 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 Rebuild (CanvasUpdate update)
 
override void SetAllDirty ()
 
override void SetLayoutDirty ()
 
void SetMask (MaskingTypes type, Vector4 maskCoords)
 Function used to set the mask type and coordinates in World Space More...
 
void SetMask (MaskingTypes type, Vector4 maskCoords, float softnessX, float softnessY)
 Function used to set the mask type, coordinates and softness More...
 
override void SetMaterialDirty ()
 Schedule updating of the material used by the text object. More...
 
override void SetVerticesDirty ()
 Schedule rebuilding of the text geometry. More...
 
void UpdateFontAsset ()
 
override void UpdateGeometry (Mesh mesh, int index)
 Function to force the regeneration 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 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...
 
- Public Member Functions inherited from TMPro.TMP_Text
virtual void ClearMesh ()
 Function to clear the geometry of the Primary and Sub Text objects. More...
 
override void CrossFadeAlpha (float alpha, float duration, bool ignoreTimeScale)
 Tweens the alpha of the CanvasRenderer color associated with this Graphic. More...
 
override void CrossFadeColor (Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
 
virtual string GetParsedText ()
 Function which returns the text after it has been parsed and rich text tags removed. 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)
 
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...
 
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...
 
virtual void SetVertices (Vector3[] vertices)
 Function to push a new set of vertices to the mesh. More...
 

Protected Member Functions

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...
 
override void Awake ()
 
override void ClearSubMeshObjects ()
 Destroy Sub Mesh Objects More...
 
override void ComputeMarginSize ()
 Update the margin width and height More...
 
override void GenerateTextMesh ()
 This is the main function that is responsible for creating / displaying the text. More...
 
override Bounds GetCompoundBounds ()
 Method returning the compound bounds of the text object and child sub objects. 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 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 Material[] GetSharedMaterials ()
 Method returning an array containing the materials used by the text object. More...
 
override Vector3[] GetTextContainerLocalCorners ()
 Method to return the local corners of the Text Container or RectTransform. More...
 
override void LoadFontAsset ()
 Method which derived classes need to override to load Font Assets. More...
 
override void OnDestroy ()
 
override void OnDidApplyAnimationProperties ()
 
override void OnDisable ()
 
override void OnEnable ()
 
override void OnRectTransformDimensionsChange ()
 
override void OnTransformParentChanged ()
 
override void SetActiveSubMeshes (bool state)
 Method to Enable or Disable child SubMesh objects. More...
 
override int SetArraySizes (int[] chars)
 Method used to determine the number of visible characters and required buffer allocations. More...
 
override void SetCulling ()
 Set the culling mode on 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 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 SetShaderDepth ()
 Set the Render Queue and ZTest mode on the current material More...
 
override void SetSharedMaterial (Material mat)
 Function called internally when a new shared material is assigned via the fontSharedMaterial property. More...
 
override void SetSharedMaterials (Material[] materials)
 Method used to assign new materials to the text and sub text objects. More...
 
override void UpdateMaterial ()
 
- Protected Member Functions inherited from TMPro.TMP_Text
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 Vector2 CalculatePreferredValues (float defaultFontSize, Vector2 marginSize, bool ignoreTextAutoSizing)
 Method to calculate the preferred width and height of the text object. 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...
 
virtual Material CreateMaterialInstance (Material source)
 Method to set the materials of the text and sub text objects. More...
 
virtual void DrawTextHighlight (Vector3 start, Vector3 end, ref int index, Color32 highlightColor)
 
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 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...
 
TMP_FontAsset GetFontAssetForWeight (int fontWeight)
 
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 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 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...
 
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...
 
void GetSpecialCharacters (TMP_FontAsset fontAsset)
 Method used to find and cache references to the Underline and Ellipsis characters. 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...
 
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...
 
int HexToInt (char hex)
 Function to pack scale information in the UV2 Channel. More...
 
virtual void InternalCrossFadeAlpha (float alpha, float duration, bool ignoreTimeScale)
 
virtual void InternalCrossFadeColor (Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
 
void LoadDefaultSettings ()
 Internal function used to load the default settings of text 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)
 
void ParseInputText ()
 Method to parse the input text based on its source 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...
 
void ResizeLineExtents (int size)
 Function to increase the size of the Line Extents Array. 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...
 
void SaveWordWrappingState (ref WordWrapState state, int index, int count)
 Function used in conjunction with GetTextInfo to figure out Array allocations. More...
 
virtual void SetFontBaseMaterial (Material mat)
 Function called internally when assigning a new base material. More...
 
void SetTextArrayToCharArray (char[] sourceText, ref int[] charBuffer)
 Copies Content of formatted SetText() to charBuffer. More...
 
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 SetVertexColorGradient (TMP_ColorGradient gradient)
 
void StringBuilderToIntArray (StringBuilder sourceText, ref int[] charBuffer)
 Copy contents of StringBuilder into int array. More...
 
void StringToCharArray (string sourceText, ref int[] charBuffer)
 Method to store the content of a string into an integer array. 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_SubMesh[] m_subTextObjects = new TMP_SubMesh[8]
 
- Protected Attributes inherited from TMPro.TMP_Text
bool checkPaddingRequired
 
TMP_XmlTagStack< int > m_actionStack = new TMP_XmlTagStack<int>(new int[16])
 
float[] m_attributeParameterValues = new float[16]
 
bool m_autoSizeTextContainer
 
float m_baselineOffset
 
TMP_XmlTagStack< float > m_baselineOffsetStack = new TMP_XmlTagStack<float>(new float[16])
 
TMP_Glyph m_cached_Ellipsis_GlyphInfo
 
TMP_TextElement m_cached_TextElement
 
TMP_Glyph m_cached_Underline_GlyphInfo
 
int[] m_char_buffer
 
int m_characterCount
 
float m_characterSpacing = 0
 
float m_charWidthAdjDelta = 0
 
float m_charWidthMaxAdj = 0f
 
TMP_ColorGradient m_colorGradientPreset
 
TMP_XmlTagStack
< TMP_ColorGradient
m_colorGradientStack = new TMP_XmlTagStack<TMP_ColorGradient>(new TMP_ColorGradient[16])
 
TMP_XmlTagStack< Color32 > m_colorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
float m_cSpacing = 0
 
TMP_FontAsset m_currentFontAsset
 
float m_currentFontSize
 
Material m_currentMaterial
 
int m_currentMaterialIndex
 
TMP_SpriteAsset m_currentSpriteAsset
 
TMP_SpriteAsset m_defaultSpriteAsset
 
bool m_enableAutoSizing
 
bool m_enableExtraPadding = false
 
bool m_enableKerning
 
bool m_enableVertexGradient
 
bool m_enableWordWrapping = false
 
Color32 m_faceColor = Color.white
 
int m_firstCharacterOfLine
 
int m_firstOverflowCharacterIndex = -1
 
int m_firstVisibleCharacter
 
int m_firstVisibleCharacterOfLine
 
float m_flexibleHeight = -1f
 
float m_flexibleWidth = -1f
 
TMP_FontAsset m_fontAsset
 
Color m_fontColor = Color.white
 
Color32 m_fontColor32 = Color.white
 
VertexGradient m_fontColorGradient = new VertexGradient(Color.white)
 
TMP_ColorGradient m_fontColorGradientPreset
 
Material m_fontMaterial
 
Material[] m_fontMaterials
 
float m_fontScale
 
float m_fontScaleMultiplier
 
Material[] m_fontSharedMaterials
 
float m_fontSize = 36
 
float m_fontSizeBase = 36
 
float m_fontSizeMax = 0
 
float m_fontSizeMin = 0
 
FontStyles m_fontStyle = FontStyles.Normal
 
TMP_BasicXmlTagStack m_fontStyleStack
 
int m_fontWeight = 400
 
int m_fontWeightInternal
 
TMP_XmlTagStack< int > m_fontWeightStack = new TMP_XmlTagStack<int>(new int[16])
 
Matrix4x4 m_FXMatrix
 
VertexSortingOrder m_geometrySortingOrder
 
bool m_havePropertiesChanged
 
Color32 m_highlightColor = s_colorWhite
 
TMP_XmlTagStack< Color32 > m_highlightColorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
TextureMappingOptions m_horizontalMapping = TextureMappingOptions.Character
 
Color32 m_htmlColor = new Color(255, 255, 255, 128)
 
char[] m_htmlTag = new char[128]
 
bool m_ignoreActiveState
 
bool m_ignoreCulling = true
 
bool m_ignoreRectMaskCulling
 
TMP_XmlTagStack< float > m_indentStack = new TMP_XmlTagStack<float>(new float[16])
 
char[] m_input_CharArray = new char[256]
 
TextInputSources m_inputSource
 
bool m_isAlignmentEnumConverted
 
bool m_isAwake
 
bool m_isCalculateSizeRequired = false
 
bool m_isCalculatingPreferredValues
 
bool m_isCharacterWrappingEnabled = false
 
bool m_isCullingEnabled = false
 
bool m_isFXMatrixSet
 
bool m_isIgnoringAlignment
 
bool m_isInputParsingRequired = false
 
bool m_isLayoutDirty
 
bool m_isLinkedTextComponent
 
bool m_isMaterialDirty
 
bool m_isNewPage = false
 
bool m_isNonBreakingSpace = false
 
bool m_isOrthographic = false
 
bool m_isOverlay = false
 
bool m_isParsingText
 
bool m_isPreferredHeightDirty
 
bool m_isPreferredWidthDirty
 
bool m_isRichText = true
 
bool m_isRightToLeft = false
 
bool m_isSDFShader
 
bool m_isTextTruncated
 
bool m_isUsingBold = false
 
bool m_isUsingLegacyAnimationComponent
 
bool m_isVolumetricText
 
int m_lastCharacterOfLine
 
int m_lastVisibleCharacterOfLine
 
bool m_layoutAlreadyDirty
 
LayoutElement m_LayoutElement
 
int m_layoutPriority = 0
 
float m_lineHeight = TMP_Math.FLOAT_UNSET
 
TextAlignmentOptions m_lineJustification
 
TMP_XmlTagStack
< TextAlignmentOptions
m_lineJustificationStack = new TMP_XmlTagStack<TextAlignmentOptions>(new TextAlignmentOptions[16])
 
int m_lineNumber
 
float m_lineOffset
 
float m_lineSpacing = 0
 
float m_lineSpacingDelta = 0
 
float m_lineSpacingMax = 0
 
int m_lineVisibleCharacterCount
 
TMP_Text m_linkedTextComponent
 
Vector4 m_margin = new Vector4(0, 0, 0, 0)
 
float m_marginHeight
 
float m_marginLeft
 
float m_marginRight
 
float m_marginWidth
 
Dictionary< int, int > m_materialReferenceIndexLookup = new Dictionary<int, int>()
 
MaterialReference[] m_materialReferences = new MaterialReference[32]
 
TMP_XmlTagStack
< MaterialReference
m_materialReferenceStack = new TMP_XmlTagStack<MaterialReference>(new MaterialReference[16])
 
float m_maxAscender
 
float m_maxCapHeight
 
float m_maxDescender
 
float m_maxFontSize
 
float m_maxHeight
 
float m_maxLineAscender
 
float m_maxLineDescender
 
int m_maxVisibleCharacters = 99999
 
int m_maxVisibleLines = 99999
 
int m_maxVisibleWords = 99999
 
float m_maxWidth
 
Mesh m_mesh
 
Extents m_meshExtents
 
float m_minFontSize
 
float m_minHeight
 
float m_minWidth
 
float m_monoSpacing = 0
 
Color32 m_outlineColor = Color.black
 
float m_outlineWidth = 0.0f
 
TextOverflowModes m_overflowMode = TextOverflowModes.Overflow
 
bool m_overrideHtmlColors = false
 
float m_padding = 0
 
int m_pageNumber
 
int m_pageToDisplay = 1
 
float m_paragraphSpacing = 0
 
bool m_parseCtrlCharacters = true
 
float m_preferredHeight
 
float m_preferredWidth
 
RectTransform m_rectTransform
 
float m_renderedHeight
 
float m_renderedWidth
 
TextRenderFlags m_renderMode = TextRenderFlags.Render
 
WordWrapState m_SavedLineState = new WordWrapState()
 
WordWrapState m_SavedWordWrapState = new WordWrapState()
 
Material m_sharedMaterial
 
TMP_XmlTagStack< float > m_sizeStack = new TMP_XmlTagStack<float>(new float[16])
 
float m_spacing = 0
 
int m_spriteAnimationID
 
TMP_SpriteAnimator m_spriteAnimator
 
TMP_SpriteAsset m_spriteAsset
 
Color32 m_spriteColor
 
int m_spriteCount = 0
 
int m_spriteIndex
 
float m_startOfLineAscender
 
Color32 m_strikethroughColor = s_colorWhite
 
TMP_XmlTagStack< Color32 > m_strikethroughColorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
FontStyles m_style = FontStyles.Normal
 
TMP_XmlTagStack< int > m_styleStack = new TMP_XmlTagStack<int>(new int[16])
 
float m_tabSpacing = 0
 
string m_text
 
TextAlignmentOptions m_textAlignment = TextAlignmentOptions.TopLeft
 
Vector3[] m_textContainerLocalCorners = new Vector3[4]
 
TMP_TextElementType m_textElementType
 
TMP_TextInfo m_textInfo
 
bool m_tintAllSprites
 
bool m_tintSprite
 
int m_totalCharacterCount
 
Transform m_transform
 
Color32 m_underlineColor = s_colorWhite
 
TMP_XmlTagStack< Color32 > m_underlineColorStack = new TMP_XmlTagStack<Color32>(new Color32[16])
 
bool m_useMaxVisibleDescender = true
 
float m_uvLineOffset = 0.0f
 
TextureMappingOptions m_verticalMapping = TextureMappingOptions.Character
 
bool m_verticesAlreadyDirty
 
float m_width = -1
 
float m_wordSpacing = 0
 
float m_wordWrappingRatios = 0.4f
 
float m_xAdvance
 
XML_TagAttribute[] m_xmlAttribute = new XML_TagAttribute[8]
 
string old_text
 
float tag_Indent = 0
 
float tag_LineIndent = 0
 
bool tag_NoParsing
 

Properties

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...
 
MaskingTypes maskType [get, set]
 Sets the mask type More...
 
override Mesh mesh [get]
 Returns the mesh assigned to the text object. More...
 
MeshFilter meshFilter [get]
 Returns the Mesh Filter of the text object. More...
 
Renderer renderer [get]
 Returns the rendered assigned to the text object. More...
 
int sortingLayerID [get, set]
 Sets the Renderer's sorting Layer ID More...
 
int sortingOrder [get, set]
 Sets the Renderer's sorting order within the assigned layer. More...
 
TextContainer textContainer [get]
 Returns a reference to the Text Container More...
 
new Transform transform [get]
 Returns a reference to the Transform More...
 
- Properties inherited from TMPro.TMP_Text
TextAlignmentOptions alignment [get, set]
 Text alignment options More...
 
float alpha [get, set]
 Sets the vertex color alpha value. More...
 
virtual bool autoSizeTextContainer [get, set]
 Enables control over setting the size of the text container to match the text object. More...
 
Bounds bounds [get]
 Returns the bounds of the mesh of the text object in world space. More...
 
float characterSpacing [get, set]
 Use the extents of the text geometry for alignment instead of font metrics. More...
 
float characterWidthAdjustment [get, set]
 Percentage the width of characters can be adjusted before text auto-sizing begins to reduce the point size. 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...
 
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...
 
bool enableAutoSizing [get, set]
 Enable text auto-sizing 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 enableKerning [get, set]
 Determines if kerning is enabled or disabled. More...
 
bool enableVertexGradient [get, set]
 Determines if Vertex Color Gradient should be used 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...
 
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...
 
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...
 
int firstOverflowCharacterIndex [get]
 The first character which exceeds the vertical bounds of its text container. More...
 
int firstVisibleCharacter [get, set]
 The first character which should be made visible in conjunction with the Text Overflow Linked mode. More...
 
float flexibleHeight [get]
 
float flexibleWidth [get]
 
TMP_FontAsset font [get, set]
 The Font Asset to be assigned to this 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...
 
float fontScale [get]
 The scale of the current text. 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...
 
float fontSize [get, set]
 The point size of the font. More...
 
float fontSizeMax [get, set]
 Maximum point size of the font when text auto-sizing is enabled. More...
 
float fontSizeMin [get, set]
 Minimum point size of the font when text auto-sizing is enabled. More...
 
FontStyles fontStyle [get, set]
 The style of the 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...
 
VertexSortingOrder geometrySortingOrder [get, set]
 Determines the sorting order of the geometry of the text object. More...
 
bool havePropertiesChanged [get, set]
 Property tracking if any of the text properties have changed. Flag is set before the text is regenerated. More...
 
TextureMappingOptions horizontalMapping [get, set]
 Controls how the face and outline textures will be applied to the text object. 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...
 
bool isLinkedTextComponent [get, set]
 Indicates whether this text component is linked to another. More...
 
bool isOrthographic [get, set]
 Sets Perspective Correction to Zero for Orthographic Camera mode & 0.875f for Perspective Camera mode. 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 isRightToLeftText [get, set]
 
bool isTextOverflowing [get]
 Indicates if the text exceeds the vertical bounds of its text container. More...
 
bool isTextTruncated [get]
 Property indicating whether the text is Truncated or using Ellipsis. More...
 
bool isUsingBold [get]
 Property used in conjunction with padding calculation for the geometry. More...
 
bool isUsingLegacyAnimationComponent [get, set]
 Property to handle legacy animation component. More...
 
bool isVolumetricText [get, set]
 Determines if the geometry of the characters will be quads or volumetric (cubes). More...
 
LayoutElement layoutElement [get]
 
int layoutPriority [get]
 
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...
 
TMP_Text linkedTextComponent [get, set]
 The linked text component used for flowing the text from one text component to another. More...
 
float mappingUvLineOffset [get, set]
 Controls the UV Offset for the various texture mapping mode on the text object. More...
 
virtual Vector4 margin [get, set]
 The margins of the text object. More...
 
float maxHeight [get]
 
int maxVisibleCharacters [get, set]
 Allows to control how many characters are visible from the input. More...
 
int maxVisibleLines [get, set]
 Allows control over how many lines of text are displayed. More...
 
int maxVisibleWords [get, set]
 Allows to control how many words are visible from the input. More...
 
float maxWidth [get]
 
virtual Mesh mesh [get]
 The mesh used by the font asset and material assigned to the text object. More...
 
float minHeight [get]
 
float minWidth [get]
 
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...
 
TextOverflowModes overflowMode [get, set]
 
bool overrideColorTags [get, set]
 This overrides the color tags forcing the vertex colors to be the default font color. More...
 
int pageToDisplay [get, set]
 Controls which page of text is shown More...
 
float paragraphSpacing [get, set]
 The amount of additional spacing to add between each lines of text. More...
 
bool parseCtrlCharacters [get, set]
 Enables or Disables parsing of CTRL characters in input text. More...
 
float pixelsPerUnit [get]
 
virtual float preferredHeight [get]
 Computed preferred height of the text object. More...
 
virtual float preferredWidth [get]
 Computed preferred width of the text object. More...
 
new RectTransform rectTransform [get]
 Returns are reference to the RectTransform More...
 
virtual float renderedHeight [get]
 Compute the rendered height of the text object. More...
 
virtual float renderedWidth [get]
 Compute the rendered width of the text object. More...
 
TextRenderFlags renderMode [get, set]
 Determines if the Mesh will be rendered. More...
 
bool richText [get, set]
 Enables or Disables Rich Text Tags More...
 
TMP_SpriteAnimator spriteAnimator [get]
 Component used to control wrapping of text following some arbitrary shape. More...
 
TMP_SpriteAsset spriteAsset [get, set]
 Default Sprite Asset used by the text object. More...
 
string text [get, set]
 A string containing the text to be displayed. More...
 
Bounds textBounds [get]
 Returns the bounds of the text 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 tintAllSprites [get, set]
 Determines whether or not the sprite color is multiplies by the vertex color of the text. More...
 
new Transform transform [get]
 Returns are reference to the Transform More...
 
bool useMaxVisibleDescender [get, set]
 Determines if the text's vertical alignment will be adjusted based on visible descender of the text. More...
 
TextureMappingOptions verticalMapping [get, set]
 Controls how the face and outline textures will be applied to the text object. More...
 
float wordSpacing [get, set]
 The amount of additional spacing between words. More...
 
float wordWrappingRatios [get, set]
 Controls the blending between using character and word spacing to fill-in the space for justified text. More...
 

Additional Inherited Members

- Protected Types inherited from TMPro.TMP_Text
enum  TextInputSources { TextInputSources.Text = 0, TextInputSources.SetText = 1, TextInputSources.SetCharArray = 2, TextInputSources.String = 3 }
 
- Static Protected Attributes inherited from TMPro.TMP_Text
static float k_LargeNegativeFloat = TMP_Math.FLOAT_MIN
 
static int k_LargeNegativeInt = TMP_Math.INT_MIN
 
static Vector2 k_LargeNegativeVector2 = new Vector2(TMP_Math.INT_MIN, TMP_Math.INT_MIN)
 
static float k_LargePositiveFloat = TMP_Math.FLOAT_MAX
 
static int k_LargePositiveInt = TMP_Math.INT_MAX
 
static Vector2 k_LargePositiveVector2 = new Vector2(TMP_Math.INT_MAX, TMP_Math.INT_MAX)
 
static Color32 s_colorWhite = new Color32(255, 255, 255, 255)
 

Member Function Documentation

override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.Awake ( )
inlineprotected
void TMPro.TextMeshPro.CalculateLayoutInputHorizontal ( )
inline
void TMPro.TextMeshPro.CalculateLayoutInputVertical ( )
inline
override void TMPro.TextMeshPro.ClearMesh ( bool  updateMesh)
inlinevirtual

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

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.ClearSubMeshObjects ( )
inlineprotectedvirtual

Destroy Sub Mesh Objects

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.ComputeMarginSize ( )
inlineprotectedvirtual

Update the margin width and height

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.GenerateTextMesh ( )
inlineprotectedvirtual

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

Reimplemented from TMPro.TMP_Text.

override Bounds TMPro.TextMeshPro.GetCompoundBounds ( )
inlineprotectedvirtual

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

Returns

Reimplemented from TMPro.TMP_Text.

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

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

Reimplemented from TMPro.TMP_Text.

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

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

Returns

Reimplemented from TMPro.TMP_Text.

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

Get the padding value for the currently assigned material.

Returns

Reimplemented from TMPro.TMP_Text.

override float TMPro.TextMeshPro.GetPaddingForMaterial ( )
inlineprotectedvirtual

Get the padding value for the currently assigned material.

Returns

Reimplemented from TMPro.TMP_Text.

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

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

Returns

Reimplemented from TMPro.TMP_Text.

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

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

Returns

Reimplemented from TMPro.TMP_Text.

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

Function used to evaluate the length of a text string.

Parameters
text
Returns

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.LoadFontAsset ( )
inlineprotectedvirtual

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

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.OnDestroy ( )
inlineprotected
override void TMPro.TextMeshPro.OnDidApplyAnimationProperties ( )
inlineprotected
override void TMPro.TextMeshPro.OnDisable ( )
inlineprotected
override void TMPro.TextMeshPro.OnEnable ( )
inlineprotected
override void TMPro.TextMeshPro.OnRectTransformDimensionsChange ( )
inlineprotected
override void TMPro.TextMeshPro.OnTransformParentChanged ( )
inlineprotected
override void TMPro.TextMeshPro.Rebuild ( CanvasUpdate  update)
inline

Parameters
update
override void TMPro.TextMeshPro.SetActiveSubMeshes ( bool  state)
inlineprotectedvirtual

Method to Enable or Disable child SubMesh objects.

Parameters
state

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.SetAllDirty ( )
inline

override int TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.SetCulling ( )
inlineprotectedvirtual

Set the culling mode on the material.

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.SetLayoutDirty ( )
inline

void TMPro.TextMeshPro.SetMask ( MaskingTypes  type,
Vector4  maskCoords 
)
inline

Function used to set the mask type and coordinates in World Space

Parameters
type
maskCoords
void TMPro.TextMeshPro.SetMask ( MaskingTypes  type,
Vector4  maskCoords,
float  softnessX,
float  softnessY 
)
inline

Function used to set the mask type, coordinates and softness

Parameters
type
maskCoords
softnessX
softnessY
override void TMPro.TextMeshPro.SetMaterialDirty ( )
inline

Schedule updating of the material used by the text object.

override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.SetShaderDepth ( )
inlineprotectedvirtual

Set the Render Queue and ZTest mode on the current material

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.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.

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

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

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.SetVerticesDirty ( )
inline

Schedule rebuilding of the text geometry.

void TMPro.TextMeshPro.UpdateFontAsset ( )
inline
override void TMPro.TextMeshPro.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.

override void TMPro.TextMeshPro.UpdateMaterial ( )
inlineprotected

override void TMPro.TextMeshPro.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.

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

Function to upload the updated vertex data and renderer.

Reimplemented from TMPro.TMP_Text.

override void TMPro.TextMeshPro.UpdateVertexData ( )
inlinevirtual

Function to upload the updated vertex data and renderer.

Reimplemented from TMPro.TMP_Text.

Member Data Documentation

TMP_SubMesh [] TMPro.TextMeshPro.m_subTextObjects = new TMP_SubMesh[8]
protected

Property Documentation

override bool TMPro.TextMeshPro.autoSizeTextContainer
getset

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

MaskingTypes TMPro.TextMeshPro.maskType
getset

Sets the mask type

override Mesh TMPro.TextMeshPro.mesh
get

Returns the mesh assigned to the text object.

MeshFilter TMPro.TextMeshPro.meshFilter
get

Returns the Mesh Filter of the text object.

Renderer TMPro.TextMeshPro.renderer
get

Returns the rendered assigned to the text object.

int TMPro.TextMeshPro.sortingLayerID
getset

Sets the Renderer's sorting Layer ID

int TMPro.TextMeshPro.sortingOrder
getset

Sets the Renderer's sorting order within the assigned layer.

TextContainer TMPro.TextMeshPro.textContainer
get

Returns a reference to the Text Container

new Transform TMPro.TextMeshPro.transform
get

Returns a reference to the Transform


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