一、新建一个脚本挂在主像机上
using UnityEngine; using System.Collections; public class GUILayoutLabelTest : MonoBehaviour { public Texture tex; void OnGUI() { GUI.Label(new Rect(10, 40, tex.width, tex.height), tex);//Label背景 GUI.Label(new Rect(50, 60, tex.width, tex.height), "please enter account");//显示文本 } }
运行效果