unity学习之GUI基础2
来源:互联网 发布:java正则表达式 . 编辑:程序博客网 时间:2024/05/16 14:10
欢迎来到unity学习社区
Label (绘制文本和图片)
Box (绘制一个图形框)
Button (绘制按钮,响应单击事件)
RepeatButton(绘制一个处理双击按下按钮的事件)
TextField (绘制一个单行文本输入框)
PasswordField (绘制一个密码输入框)
TextArea (绘制一个多行文本输入框)
Label (绘制文本 不可点击 不可删除)
GUI.Label(new Rect(20,20,20,20),"Hello World");
public Texture2D img;
GUI.Label(new Rect(20,20,img.width,img.heiget),img);
Box (文本边框 不可点击 不可删除)
GUI.Box(new Rect(20,20,20,20),"Hello Word");
public Texture2D img;
GUI.Box(new Rect(20,20,img.width,img.heght),img);
Buttom(按键)(单击)
public texture2D img
GUI. Button(new Rect(20,20,100,20),"Hello Word");
GUI.Button(new rect(20,20,img.width,img.height),img);
GUI.Button(new Rect(20,80,150,20),new GUIContent("我有提示",“恭喜你中奖了”));
GUI.label(new rect(20,20,100,20),GUI.tooltip);
RepeatButton(双击)
public texture2D img
GUI. RepeatButton(new Rect(20,20,100,20),"Hello Word");
GUI.RepeatButton(new rect(20,20,img.width,img.height),img);
GUI.RepeatButton(new Rect(20,80,150,20),new GUIContent("我有提示",“恭喜你中奖了”));
GUI.label(new rect(20,20,100,20),GUI.tooltip);
TextField(输入框)
string str="Hello World";
str=GUI.TextField(new rect(20,20,200,40),str,10);
passwordField
string str="";
str=GUI.passwordField(new rect(10,20,200,20),str,"*",10);
TextArea (文本域)
string str = "Hello Word";
str=GUI.TextArea(new rect(20,20,200,100),str,100)
Application.LoadLevel("Login"); //跳转到登陆页面
Application.LoadLevel(Application.loadedLevelName);//重新跳转本页面
Application.Quit(); //退出游戏 注:在游戏发布后可使用
GUI.skin.label.fontSize=50;//设置字体大小
GUI.color = Color.red;//设置字体颜色
游戏暂停和开始
游戏暂停
Time.timeScale=0;
游戏开始
Time.timeScale=1;
0 0
- unity学习之GUI基础2
- Unity学习之GUI基础
- unity之GUI基础
- Unity之GUI基础
- unity之GUI基础
- Unity学习之GUI
- Unity学习之GUI
- unity学习之GUI
- unity之GUI基础(二)
- 学习Unity3D之GUI基础2。
- unity学习之GUI登陆界面
- Unity学习之GUI常用函数
- 学习Unity3D之GUI基础。
- 01.Unity GUI基础
- C#编写Unity基础GUI之按钮控件
- Unity之GUI复习
- unity学习之数据库基础
- unity学习之NGUI基础
- eclipse项目引用项目方法
- 如何在 Linux 中使用屏幕键盘
- 1003 我要通过!
- HTTP协议
- 1004 成绩排名
- unity学习之GUI基础2
- Struts2<4>值栈与 OGNL
- 敏捷开发之Scrum扫盲篇
- ubuntu 12.04版本交叉编译器安装的相关问题
- hoj 1058 Number Triangles
- uva10913(dp + 回溯)
- 1005 继续(3n+1)猜想
- git发布代码到github过程和常见错误
- Java中使用Jedis操作Redis