Unity GUI设置字体大小

用GUIStyle来设置字体

void OnGUI()
    {
        GUIStyle fontStyle = new GUIStyle();
        fontStyle.normal.background = null;    //设置背景填充
        fontStyle.normal.textColor= new Color(1,0,0);   //设置字体颜色
        fontStyle.fontSize = 40;       //字体大小
        GUI.Label(new Rect(0, 0, 200, 200), "Hello Font", fontStyle);
    }


 
  

 
  

你可能感兴趣的:(Unity)