如何在Unity的GUI中更改字体类型

7

我在Unity中使用GUI来显示这段文字:

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


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

我想将文本变成这样:

输入图像描述

1个回答

7
请将您的GUI代码修改为以下内容。
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>");

如果您想更改字体类型,则可以尝试使用此rich标记,并告诉我它是否起作用。

<font face="verdana">....</font>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接