GUI

来源:互联网 发布:mac香港专柜地址查询 编辑:程序博客网 时间:2024/06/03 14:22
using UnityEngine;using System.Collections;public class NewBehaviourScript : MonoBehaviour {// Use this for initializationvoid Start () {}// Update is called once per framevoid Update () {}    private string str = "";    private string str2 = "";    private bool sex = false;    private string _username = string.Empty;    private string _userpassword = string.Empty;    private bool _sex = false;void OnGUI(){        //第一个参数:距离左边        //第二个参数:距离上边        //第三个参数:长        //第四个参数:宽       GUI.Label(new Rect(10, 10, 70, 20),"用户名");       _username = GUI.TextArea(new Rect(80,10,200,20),_username);       GUI.Label(new Rect(10, 30, 70, 20), "密码:");       _userpassword = GUI.PasswordField(new Rect(80, 30, 200, 20),_userpassword,'*');       _sex = GUI.Toggle(new Rect(10, 70, 50, 20), _sex, "男");       _sex = GUI.Toggle(new Rect(10, 120, 50, 20), !_sex, "女");       GUI.RepeatButton(new Rect(10, 140, 50, 20), "OK");}}

0 0
原创粉丝点击