GUI基础:
1、Label: (不带边框的)
Label (position : Rect, text : string) : void
Label (position : Rect, image : Texture) : void
Label (position : Rect, content : GUIContent) : void
Label (position : Rect, text : string, style : GUIStyle) : void
Label (position : Rect, image : Texture, style : GUIStyle) : void
Label (position : Rect, content : GUIContent, style : GUIStyle) : void
public Texture2D img;
void OnGUI() {
GUI.Label(new Rect( 20, 30, 100, 40)," Hello Word", style:" 10"); //字体
20:离界面最左边的距离
30:离界面最上边的距离
100:字体的长度
40:字体的高度
"Hello Word":要输入的内容
style:内容字体的长度
GUI.Label(new Rect(10,50,img.width,img.height),img); //图片
}
1、Label: (不带边框的)
Label (position : Rect, text : string) : void
Label (position : Rect, image : Texture) : void
Label (position : Rect, content : GUIContent) : void
Label (position : Rect, text : string, style : GUIStyle) : void
Label (position : Rect, image : Texture, style : GUIStyle) : void
Label (position : Rect, content : GUIContent, style : GUIStyle) : void
public Texture2D img;
void OnGUI() {
GUI.Label(new Rect( 20, 30, 100, 40)," Hello Word", style:" 10"); //字体
20:离界面最左边的距离
30:离界面最上边的距离
100:字体的长度
40:字体的高度
"Hello Word":要输入的内容
style:内容字体的长度
GUI.Label(new Rect(10,50,img.width,img.height),img); //图片
}