### Basic Tag Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html A simple example demonstrating the use of basic rich text tags for formatting. ```csharp Bold, Italic, and Blue text. ``` -------------------------------- ### Example of Repetitive Formatting Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/StyleSheets.html This example demonstrates the verbose way to format text, which can be simplified by using style sheets. ```text *Heading*
``` -------------------------------- ### Custom Tag Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Shows how to use custom tags for specific formatting needs. Ensure custom tags are registered. ```csharp Custom Formatted Text ``` -------------------------------- ### Sprite and Link Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Demonstrates the use of sprite and link tags within the same text. ```csharp Check out this Unity link! ``` -------------------------------- ### Advanced Styling Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Combines multiple tags for advanced text styling, including size, color, and styles. ```csharp This is a large, magenta, bold, italic text. ``` -------------------------------- ### TextMeshPro Tag Examples Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextPos.html Demonstrates setting horizontal positions using percentages with the tag. Best used with left alignment. ```textmeshpro at 75% at 25% at 50% at 0% ``` -------------------------------- ### TextMeshPro Rich Text Alignment Examples Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextAlignment.html Demonstrates various horizontal text alignment options using TextMeshPro's rich text tags. Use these tags to override the default alignment of a TextMeshPro object. ```text Left-aligned Center-aligned Right-aligned Justified: stretched to fill the display area (except for the last line) Flush: stretched to fill the display area (including the last line) ``` -------------------------------- ### Basic Rich Text Tag Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichText.html Use simple rich text tags like `` for bold or `` for underline to format text inline. These tags do not require attributes or values. ```text This text is bold This text is underlined ``` -------------------------------- ### Applying a Custom Style Sheet Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/StyleSheets.html Use the ` ``` -------------------------------- ### Gradient Tinting with Vertex Colors Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextGradient.html Gradients applied via the `` tag are multiplied by the TextMesh Pro object's current vertex colors. This example shows a gradient tinted by red vertex colors. ```text This Light to Dark Green gradient is tinted by the red vertex color ``` -------------------------------- ### Rich Text Tag Scope Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichText.html Demonstrates how a rich text tag affects text from its position forward. If the same tag is used multiple times, the last tag supersedes previous ones. ```text This text turns red ``` -------------------------------- ### Using for Bullet Points Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextIndentation.html Demonstrates how to use the tag with a percentage value to create a bulleted list. The indentation persists across lines, ensuring consistent alignment even with word wrapping. ```text 1. It is useful for things like bullet points. 2. It is handy. ``` -------------------------------- ### Outline and Underlay Tags Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Apply outlines and underlays using and tags. These affect the appearance of the text. ```csharp Outlined Text Character Spacing ``` -------------------------------- ### Basic Styling Combination Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Combine multiple rich text tags to achieve complex formatting. Ensure tags are properly nested. ```csharp This is styled text. ``` -------------------------------- ### Applying Successive Color Tags Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextColor.html Demonstrates how TextMesh Pro handles multiple color tags applied sequentially. The last applied color tag takes precedence until a closing tag is encountered or a new color tag is applied. ```text Red Dark Green <#0000FF>Blue Semitransparent Red ``` -------------------------------- ### Nested Rich Text Tags Example Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichText.html Tags can be nested to apply formatting within another tag's scope. Closing tags `` can be used to limit the scope of a tag, and they do not need to be closed in the order they were opened. ```text This text is mostly red. ``` -------------------------------- ### Using Subscript and Superscript Tags Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSubSuper.html Apply and tags directly within your TextMeshPro text to render characters as subscript or superscript. This is useful for scientific notation or ordinal numbers. ```text We have 1m3 of H2O. ``` -------------------------------- ### Apply Custom Style with You can create your own. ``` -------------------------------- ### Link Tag Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Create clickable links with the tag. Assign a URL or an identifier to the href attribute. ```csharp Visit our website. Click here to open a panel. ``` -------------------------------- ### Control Line Height with Tag Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextLineHeight.html Demonstrates how to use the tag to adjust spacing between lines. Values can be percentages, pixels, or font units. The closing tag reverts to the default. ```text Line height at 100% Line height at 50% Rather cozy. Line height at 150% Such distance! ``` -------------------------------- ### Basic Color Tag Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Use the tag to apply color to text. Specify the color name or hex code. ```csharp This text is red. This text is green. ``` -------------------------------- ### Font Style Tags Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Apply bold, italic, and underline styles using the , , and tags respectively. ```csharp This text is bold. This text is italic. This text is underlined. ``` -------------------------------- ### Using Closing Color Tags Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextColor.html Illustrates the use of the closing `` tag to end the scope of a specific color and revert to the previous color or default. This allows for precise control over color application within a text string. ```text Red, Blue, and red again. ``` -------------------------------- ### Changing Font and Material with Rich Text Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextFont.html Use the `` tag to specify a font asset and the `material` attribute to apply a different material to that font. The changes persist until a closing `` tag or a new `` tag is encountered. You can revert to the default font by using ``. ```text Would you like a different font? or just a different material? ``` -------------------------------- ### Apply Line Indentation with Percentage Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextLineIndentation.html Use the tag with a percentage value to indent subsequent lines. This is useful for creating structured text where specific lines need to be offset. ```text This is the first line of this text example. This is the second line of the same text. ``` -------------------------------- ### Applying Gradient Presets to Text Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextGradient.html Use the `` tag with a preset name to apply a gradient to text. The closing `` tag reverts to the original color. ```text Apply any gradient preset to your text ``` -------------------------------- ### Applying Pure Gradients by Resetting Vertex Color Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextGradient.html To apply a pure gradient without tinting from vertex colors, use a `` tag set to white before applying the `` tag. ```text This Light to Dark Green gradient is no longer tinted by the red vertex color ``` -------------------------------- ### Using for Vertical Text Offset Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextVOffset.html Demonstrates how to use the tag to position text elements above or below the baseline. The offset is relative to the original baseline and affects line height. ```text Up up UP and down we go again. ``` -------------------------------- ### Vertex Gradient Tag Source: https://docs.unity3d.com/Packages/com.unity.textmeshpro%404.0/manual/RichTextSupportedTags.html Apply vertex gradients to text using the tag. Specify colors for the gradient stops. ```csharp Gradient Text ```