Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the font type in GUI in unity

Tags:

unity3d

I used GUI to display this text in unity :

GUI.Label(Rect(430,320,500,500),"Win");


GUI.Label(Rect(400,470,500,500),"Your scores :" +player_script.points);

I want to make the text like this :

enter image description here

like image 541
Akari Avatar asked Oct 10 '13 09:10

Akari


People also ask

How do I change the font style in Unity?

To add a font to your project you need to place the font file in your Assets folder. Unity will then automatically import it. Supported Font formats are TrueType Fonts (. ttf files) and OpenType Fonts (.


1 Answers

Modify your gui code like this

GUI.Label(Rect(430,320,500,500),"<color=green><size=100>Win</size></color>");


GUI.Label(Rect(400,470,500,500),"<color=green><size=35>Your scores : </size></color>"+"<color=black><size=35>"+player_script.points+"</size></color>");

also if you want to change the font type then you can try this rich tag and let me know if it has worked

<font face="verdana">....</font>
like image 144
elie111 Avatar answered Sep 19 '22 11:09

elie111