Class TMP_Text
Base class which contains common properties and functions shared between the TextMeshPro and TextMeshProUGUI component.
Inherited Members
Namespace: TMPro
Assembly: solution.dll
Syntax
public abstract class TMP_Text : MaskableGraphic, ICanvasElement, IClippable, IMaskable, IMaterialModifier
Fields
Properties
Name | Description |
---|---|
alignment | Text alignment options |
alpha | Sets the vertex color alpha value. |
auto |
Enables control over setting the size of the text container to match the text object. |
bounds | Returns the bounds of the mesh of the text object in world space. |
character |
The amount of additional spacing between characters. |
character |
Percentage the width of characters can be adjusted before text auto-sizing begins to reduce the point size. |
color | This is the default vertex color assigned to each vertices. Color tags will override vertex colors unless the overrideColorTags is set. |
color |
Sets the vertex colors for each of the 4 vertices of the character quads. |
color |
Set the vertex colors of the 4 vertices of each character quads. |
enable |
Enable text auto-sizing |
enable |
Sets the culling on the shaders. Note changing this value will result in an instance of the material. |
enable |
Determines if kerning is enabled or disabled. |
enable |
Determines if Vertex Color Gradient should be used |
enable |
Controls whether or not word wrapping is applied. When disabled, the text will be displayed on a single line. |
extra |
Adds extra padding around each character. This may be necessary when the displayed text is very small to prevent clipping. |
face |
Sets the color of the _FaceColor property of the assigned material. Changing face color will result in an instance of the material. |
first |
The first character which exceeds the vertical bounds of its text container. |
first |
The first character which should be made visible in conjunction with the Text Overflow Linked mode. |
flexible |
|
flexible |
|
font | The Font Asset to be assigned to this text object. |
font |
The material to be assigned to this text object. An instance of the material will be assigned to the object's renderer. |
font |
The materials to be assigned to this text object. An instance of the materials will be assigned. |
font |
The scale of the current text. |
font |
The material to be assigned to this text object. |
font |
An array containing the materials used by the text object. |
font |
The point size of the font. |
font |
Maximum point size of the font when text auto-sizing is enabled. |
font |
Minimum point size of the font when text auto-sizing is enabled. |
font |
The style of the text |
font |
Control the weight of the font if an alternative font asset is assigned for the given weight in the font asset editor. |
geometry |
Determines the sorting order of the geometry of the text object. |
have |
Property tracking if any of the text properties have changed. Flag is set before the text is regenerated. |
horizontal |
Horizontal alignment options |
horizontal |
Controls how the face and outline textures will be applied to the text object. |
ignore |
Forces objects that are not visible to get refreshed. |
is |
|
is |
Sets the RenderQueue along with Ztest to force the text to be drawn last and on top of scene elements. |
is |
|
is |
Determines if a text object will be excluded from the InternalUpdate callback used to handle updates of SDF Scale when the scale of the text object or parent(s) changes. |
is |
Indicates if the text exceeds the vertical bounds of its text container. |
is |
Property indicating whether the text is Truncated or using Ellipsis. |
is |
Property used in conjunction with padding calculation for the geometry. |
is |
Property to handle legacy animation component. |
is |
Determines if the geometry of the characters will be quads or volumetric (cubes). |
layout |
|
layout |
|
line |
The amount of additional spacing to add between each lines of text. |
line |
The amount of potential line spacing adjustment before text auto sizing kicks in. |
linked |
The linked text component used for flowing the text from one text component to another. |
mapping |
Controls the horizontal offset of the UV of the texture mapping mode for each line of the text object. |
margin | The margins of the text object. |
max |
|
max |
Allows to control how many characters are visible from the input. |
max |
Allows control over how many lines of text are displayed. |
max |
Allows to control how many words are visible from the input. |
max |
|
mesh | The mesh used by the font asset and material assigned to the text object. |
min |
|
min |
|
outline |
Sets the color of the _OutlineColor property of the assigned material. Changing outline color will result in an instance of the material. |
outline |
Sets the thickness of the outline of the font. Setting this value will result in an instance of the material. |
overflow |
Controls the Text Overflow Mode |
override |
This overrides the color tags forcing the vertex colors to be the default font color. |
page |
Controls which page of text is shown |
paragraph |
The amount of additional spacing to add between each lines of text. |
parse |
Enables or Disables parsing of CTRL characters in input text. |
pixels |
|
preferred |
Computed preferred height of the text object. |
preferred |
Computed preferred width of the text object. |
rect |
Returns are reference to the RectTransform |
render |
Determines if the Mesh will be rendered. |
rendered |
Compute the rendered height of the text object. |
rendered |
Compute the rendered width of the text object. |
rich |
Enables or Disables Rich Text Tags |
sprite |
Component used to control and animate sprites in the text object. |
sprite |
Sprite Asset used by the text object. |
style |
Style sheet used by the text object. |
text | A string containing the text to be displayed. |
text |
Returns the bounds of the text of the text object. |
text |
Returns data about the text object which includes information about each character, word, line, link, etc. |
text |
The ITextPreprocessor component referenced by the text object (if any) |
text |
|
tint |
Determines whether or not the sprite color is multiplies by the vertex color of the text. |
transform | Returns are reference to the Transform |
use |
Determines if the text's vertical alignment will be adjusted based on visible descender of the text. |
vertex |
Determines if the data structures allocated to contain the geometry of the text object will be reduced in size if the number of characters required to display the text is reduced by more than 256 characters. This reduction has the benefit of reducing the amount of vertex data being submitted to the graphic device but results in GC when it occurs. |
vertical |
Vertical alignment options |
vertical |
Controls how the face and outline textures will be applied to the text object. |
word |
The amount of additional spacing between words. |
word |
Controls the blending between using character and word spacing to fill-in the space for justified text. |
Methods
Name | Description |
---|---|
Adjust |
Method to adjust line spacing as a result of using different fonts or font point size. |
Calculate |
Method to calculate the preferred width and height of the text object. |
Char |
Copies Content of formatted SetText() to charBuffer. |
Clear |
Function to clear the geometry of the Primary and Sub Text objects. |
Clear |
Function to clear the geometry of the Primary and Sub Text objects. |
Compute |
Function to force an update of the margin size. |
Convert |
Extracts a float value from char[] assuming we know the position of the start, end and decimal point. |
Convert |
Extracts a float value from char[] given a start index and length. |
Create |
Function used to create an instance of the material |
Cross |
Tweens the alpha of the CanvasRenderer color associated with this Graphic. |
Cross |
Tweens the CanvasRenderer color associated with this Graphic. |
Destroy |
Destroy Sub Mesh Objects. |
Draw |
|
Draw |
Method to add the underline geometry. |
Fill |
Store vertex attributes into the appropriate TMP_MeshInfo. |
Fill |
|
Fill |
Fill Vertex Buffers for Sprites |
Force |
Function to force regeneration of the text object before its normal process time. This is useful when changes to the text object properties need to be applied immediately. |
Generate |
Method which parses the text input, does the layout of the text as well as generating the geometry. |
Get |
Method returning the compound bounds of the text object and child sub objects. |
Get |
|
Get |
|
Get |
Function called internally when a new material is assigned via the fontMaterial property. |
Get |
Method returning instances of the materials used by the text object. |
Get |
Get the padding value for the currently assigned material |
Get |
Get the padding value for the given material |
Get |
Function which returns the text after it has been parsed and rich text tags removed. |
Get |
Method to calculate the preferred height of a text object. |
Get |
Function to Calculate the Preferred Width and Height of the text object. |
Get |
Function to Calculate the Preferred Width and Height of the text object given the provided width and height. |
Get |
Function to Calculate the Preferred Width and Height of the text object given a certain string. |
Get |
Function to Calculate the Preferred Width and Height of the text object given a certain string and size of text container. |
Get |
Method to calculate the preferred width of a text object. |
Get |
Method returning the rendered height of the text object. |
Get |
Method returning the rendered width and height of the text object. |
Get |
|
Get |
Method returning the rendered width of the text object. |
Get |
Method which returns an array containing the materials used by the text object. |
Get |
Method used to find and cache references to the Underline and Ellipsis characters. |
Get |
Method which returns the bounds of the text object; |
Get |
Method which returns the bounds of the text object; |
Get |
Method to return the local corners of the Text Container or RectTransform. |
Get |
Function used to evaluate the length of a text string. |
Get |
|
Get |
Convert UTF-16 Hex to Char |
Get |
Convert UTF-16 Hex to Char |
Get |
|
Get |
Convert UTF-32 Hex to Char |
Get |
Convert UTF-32 Hex to Char |
Get |
|
Hex |
Method to convert Hex color values to Color32 |
Hex |
Method to convert Hex Color values to Color32 |
Hex |
Method to convert Hex to Int |
Insert |
Function used in conjunction with GetTextInfo to figure out Array allocations. |
Internal |
|
Internal |
|
Load |
Internal function used to load the default settings of text objects. |
Load |
Method which derived classes need to override to load Font Assets. |
Pack |
|
Pack |
Function to pack scale information in the UV2 Channel. |
Parse |
Method to parse the input text based on its source |
Replace |
Replace a given number of characters (tag) in the array with a new character and shift subsequent characters in the array. |
Resize |
Function to increase the size of the Line Extents Array. |
Restore |
Restore the State of various variables used in the mesh creation loop. |
Save |
Store vertex information for each character. |
Save |
Store vertex information for each sprite. |
Save |
Save the State of various variables used in the mesh creation loop in conjunction with Word Wrapping |
Set |
Method to Enable or Disable child SubMesh objects. |
Set |
Method used to determine the number of visible characters and required buffer allocations. |
Set |
Character array containing the text to be displayed. |
Set |
Character array containing the text to be displayed. |
Set |
Character array containing the text to be displayed. |
Set |
Set the culling mode on the material. |
Set |
Function called internally to set the face color of the material. This will results in an instance of the material. |
Set |
Function called internally when assigning a new base material. |
Set |
Function called internally to set the outline color of the material. This will results in an instance of the material. |
Set |
Function called internally to set the outline thickness property of the material. This will results in an instance of the material. |
Set |
Set the Render Queue and ZTest mode on the current material |
Set |
Function called internally when a new shared material is assigned via the fontSharedMaterial property. |
Set |
|
Set |
Set the text using a char array. |
Set |
Set the text using a char array with specified starting character and length. |
Set |
|
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Formatted string containing a pattern and a value representing the text to be rendered. Ex. TMP_Text.SetText("A = {0}, B = {1:00}, C = {2:000.0}", 10.75f, 10.75f, 10.75f); Results "A = 10.75, B = 11, C = 010.8." |
Set |
Set the text using a StringBuilder. |
Set |
Function to sort the geometry of the text object in accordance to the provided order. |
Set |
Function to control the sorting of the geometry of the text object. |
Set |
|
Set |
Function to push a new set of vertices to the mesh. |
String |
Copy contents of StringBuilder into int array. |
String |
Method to store the content of a string into an integer array. |
Update |
Function to update the geometry of the main and sub text objects. |
Update |
Function to be used to force recomputing of character padding when Shader / Material properties have been changed via script. |
Update |
Function to push the updated vertex data into the mesh and renderer. |
Update |
Function to push the updated vertex data into the mesh and renderer. |
Validate |
Function to identify and validate the rich tag. Returns the position of the > if the tag was valid. |
Events
Name | Description |
---|---|
On |
|
On |
Event delegate to allow modifying the text geometry before it is uploaded to the mesh and rendered. |
On |