- Home /
How to change the text of textmesh pro text
Hi guys I am using a textmesh pro text and i want to change the text style to a custom text i imported. It does not allow me to do that Can anyone help me how to do that Thanks a lot!!!!!! (FAST)
Answer by Prastiwar · Jan 27, 2018 at 01:32 PM
You can change it as on UGUI.
TextMeshProUGUI TextPro;
TextPro.text = "Some String";
Thanks But I want to change the font style! Basically like how in normal text i can change from airel to a custom one... i want to do that with textmeshpro text Thanks But Plz Help!!!
So, you want probably change a font. Click window -> Text$$anonymous$$eshPro -> Font asset creator -> generate with custom font and its settings you want -> save -> in script make
public T$$anonymous$$P_FontAsset font;
TextPro.font = font;
Font style you can change by TextPro.fontStyle = FontStyles.(bold or watever).
Thanks will try this out !!!!!!!!!!!!!!!!
Answer by codemaker2015 · Oct 28, 2020 at 02:15 PM
Using TMPro;
public class TextMeshProDemo : MonoBehaviour
{
[SerializeField]
private TextMeshPro textMeshPro;
void Start()
{
textMeshPro.text = "Some text";
}
}
Your answer
Follow this Question
Related Questions
How to access a Text Mesh Pro Font Asset's glyp info from c#? 1 Answer
Text Material overlay not supporting Masks 0 Answers
compress photos on import 0 Answers
Atlasing bug with TextMesh?, 1 Answer
TextMesh Pro Page content 2 Answers