1、Label:Label (position : Rect, text : string) : voidLabel (position : Rect, image : Texture) : voidLabel (position : Rect, content : GUIContent) : voidLabel (position : Rect, text : string, style : GUIStyle) : voidLabel (position : Rect, image : Texture, style : GUIStyle) : voidLabel (position : Rect, content : GUIContent, style : GUIStyle) : void public Texture2D img;void OnGUI() { GUI.Label(new Rect(, , , ), "Hello World!"); GUI.Label(new Rect(,,img.width,img.height),img); }2、BoxBox (position : Rect, text : string) : voidBox (position : Rect, image : Texture) : voidBox (position : Rect, content : GUIContent) : voidBox (position : Rect, text : string, style : GUIStyle) : voidBox (position : Rect, image : Texture, style : GUIStyle) : voidBox (position : Rect, content : GUIContent, style : GUIStyle) : void public Texture2D img;void OnGUI() { GUI.Label(new Rect(, , , ), "Hello World!"); GUI.Label(new Rect(,,img.width,img.height),img); }3、ButtonButton (position : Rect, text : String) : boolButton (position : Rect, image : Texture) : boolButton (position : Rect, content : GUIContent) : boolButton (position : Rect, text : String, style : GUIStyle) : boolButton (position : Rect, image : Texture, style : GUIStyle) : boolButton (position : Rect, content : GUIContent, style : GUIStyle) : bool GUI.Button(new Rect(, , , ), "Hello World!");GUI.Button(new Rect(, , img.width, img.height), img);GUI.Button(new Rect(, , , ), new GUIContent("我有提示", "恭喜你中奖了!"));// 在旁边的位置显示提示信息。GUI.Label(new Rect(, , , ), GUI.tooltip);//按钮上面有图片GUI.Button(new Rect(, , , ), new GUIContent("我有提示", img));4、RepeatButtonRepeatButton (position : Rect, text : String) : boolRepeatButton (position : Rect, image : Texture) : boolRepeatButton (position : Rect, content : GUIContent) : boolRepeatButton (position : Rect, text : String, style : GUIStyle) : boolRepeatButton (position : Rect, image : Texture, style : GUIStyle) : boolRepeatButton (position : Rect, content : GUIContent, style : GUIStyle) : bool GUI.RepeatButton(new Rect(, , , ), "Hello World!");GUI.RepeatButton(new Rect(, , img.width, img.height), img);GUI.RepeatButton(new Rect(, , , ), new GUIContent("我有提示", "恭喜你中奖了!"));// 在旁边的位置显示提示信息。 GUI.RepeatButton(new Rect(, , , ), GUI.tooltip); GUI.RepeatButton(new Rect(, , , ), new GUIContent("我有提示", img));5、TextFieldTextField (position : Rect, text : String) : StringTextField (position : Rect, text : String, maxLength : int) : StringTextField (position : Rect, text : String, style : GUIStyle) : StringTextField (position : Rect, text : String, maxLength : int, style : GUIStyle) : String string str="Hello World";str = GUI.TextField(new Rect(, , , ), str);str = GUI.TextField(new Rect(, , , ), str, );6、PasswordFieldPasswordField (position : Rect, password : String, maskChar : char) : StringPasswordField (position : Rect, password : String, maskChar : char, maxLength : int) : StringPasswordField (position : Rect, password : String, maskChar : char, style : GUIStyle) : StringPasswordField (position : Rect, password : String, maskChar : char, maxLength : int, style : GUIStyle) : String "*"[0]等价于'*'string str= "请输入密码:";str= GUI.PasswordField(new Rect(, , , ), str, "*"[0]);str= GUI.PasswordField(new Rect(, , , ), str, "*"[0],);7、TextAreaTextArea (position : Rect, text : String) : StringTextArea (position : Rect, text : String, maxLength : int) : StringTextArea (position : Rect, text : String, style : GUIStyle) : StringTextArea (position : Rect, text : String, maxLength : int, style : GUIStyle) : String string str = "aaaanbbbb";str = GUI.TextArea(new Rect(, , , ), str);str = GUI.TextArea(new Rect(, , , ), str, );更多精彩请关注:
推荐整理分享unity3d---GUI基础(unity gui),希望有所帮助,仅作参考,欢迎阅读内容。
![unity3d---GUI基础(unity gui)](https://www.jiuchutong.com/image/20240129/1706505167.jpg)
文章相关热门搜索词:unity gui教程,unity3d菜鸟入门,unity guid,unity3d菜鸟入门,unity3d基础教程,unity3d gui,unity3d的,unity3d基础教程,内容如对您有帮助,希望把文章链接给更多的朋友!
数据库的基本操作 命令行1、显示当前数据库服务器中的数据库列表:mysqlSHOWDATABASES;2、建立数据库:mysqlCREATEDATABASE库名;3、建立数据表:mysqlUSE库名;mysqlCREATETABLE表名(字段
unity集成facebook时,openssl android key 的一个解答 Q:IamtryingtointegratefacebookSDKforunity.
unity学习之GUI 今天我们学习了GUI即用户图形界面GUI的几个方法。LabelLabel(position:Rect,text:string):voidLabel(position:Rect,image:Texture):voidGUI.Label(newRect(,,,),HellowWorld);Texture2