交互媒体设计(拓展) 交互媒体设计(拓展) 课件 第03章 Unity3D图形用户界面基础.ppt

交互媒体设计(拓展) 交互媒体设计(拓展) 课件 第03章 Unity3D图形用户界面基础.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
3.1 GUI图形用户界面系统 3.1.1 Button 控件 Button控件用于在界面上创建一个按钮。当用户点击时会触发相应的功能,在游戏中通常用于界面、游戏功能、游戏设置的开关。 1 static function Button (position : Rect, text : String) : bool 2 static function Button (position : Rect, image :Texture) : bool 3 static function Button (position : Rect, content : GUIContent) : bool 4 static function Button (position : Rect, text :String, style :GUIStyle) : bool 3.1 GUI图形用户界面系统 3.1 GUI图形用户界面系统 3.1.1 Button 控件 12 if (GUI.Button(new Rect(Screen.width / 9, Screen.height / 4, 13 Screen.height / 5, Screen.height / 10), 按钮)) { //通过第一种方法实现Button控件 14 Debug.Log(static function Button (position : Rect, text : String) : bool); 15 } 16 if (GUI.Button(new Rect(Screen.width / 3, Screen.height / 4, 17 Screen.height / 5, Screen.height / 5), test)){ //通过第二种方法实现Button控件 18 Debug.Log(static function Button (position : Rect, image : Texture) : bool); 19 } 3.1 GUI图形用户界面系统 3.1.1 Button 控件 20 if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 4, 21 Screen.height / 5, Screen.height / 10), guiContent)){ //通过第三种方法实现Button控件 22 Debug.Log(static function Button (position : Rect, content : GUIContent) : bool); 23 } 24 if (GUI.Button(new Rect(Screen.width / 1.5f, Screen.height / 4, 25 Screen.height / 5, Screen.height / 5), 按钮4, guiStyle)){ //通过第四种方法实现Button控件 26 Debug.Log(static function Button (position : Rect, text : String, style : GUIStyle) : bool); 27 }}} 3.1 GUI图形用户界面系统 3.1.2 Label控件 Label控件是在设备的屏幕上创建文本标签或纹理标签,一般用于提示用户一些信息。 1 static function Label (position : Rect, text : string) : void 2 static function Label (position : Rect, image : Texture) : void 3 static function Label (position : Rect, content :GUIContent) : void 4 static function Label (position : Rect, content : GUIContent, style : GUIStyle) : void 3.1 GUI图形用户界面系统 3.1 GUI图形用户界面系统 3.1.2 Label控件 13 GUI.Label(new Rect(Screen.width / 8.5f, Screen.height / 7,

文档评论(0)

WanDocx + 关注
实名认证
内容提供者

大部分文档都有全套资料,如需打包优惠下载,请留言联系。 所有资料均来源于互联网公开下载资源,如有侵权,请联系管理员及时删除。

1亿VIP精品文档

相关文档