Answers for "textmeshpro text"

C#
9

how to edit text mesh pro text

using UnityEngine;
using System.Collections;
using TMPro;

public class ExampleClass : MonoBehaviour
{
	public TextMeshProUGUI textDisplay;
    
    void Example()
    {
        textDisplay.text = "Example Text"      
    }
}
Posted by: Guest on August-12-2020
1

textmeshpro text

using TMPro;

public TextMeshProUGUI text;
text.text = "Text updated. <sub>Subscript</sub> <sup>Superscript</sup> <b>Bold</b> <u>Underlined</u>";
Posted by: Guest on September-22-2021
1

change textmesh pro text

using UnityEngine;
using System.Collections;
using TMPro;

public class ExampleClass : MonoBehaviour
{
    void Example()
    {
        TextMeshPro textmeshPro = GetComponent<TextMeshPro>();
        textmeshPro.SetText("The first number is {0} and the 2nd is {1:2} and the 3rd is {3:0}.", 4, 6.345f, 3.5f);
        // The text displayed will be:
        // The first number is 4 and the 2nd is 6.35 and the 3rd is 4.
    }
}
Posted by: Guest on August-11-2020
8

unity get textmesh pro component

GetComponent<TMPro.TextMeshProUGUI>().text
Posted by: Guest on May-22-2020

C# Answers by Framework

Browse Popular Code Answers by Language