代码动态改变 NGUI UILabel 的字体

 

有一次因为 ttf 分成简体和繁体两个。。所以就需要动态改变NGUI 中 UILabel 的字体,但是不知道 UILabel 保存字体的字段是哪个

网上搜到。。在这里记录一下

 1 using UnityEngine;
 2 using System.Collections;
 3 
 4 public class ChangeFont : MonoBehaviour {
 5 
 6     public UILabel label; 
 7     public Font otherFont;
 8 
 9     void Start()
10     {
11         label.trueTypeFont = otherFont;
12     }      
13 
14 }
posted @ 2015-06-26 20:14  gabo  阅读(1362)  评论(0编辑  收藏  举报