TextField PasswordField

来源:互联网 发布:双11淘宝客服工作总结 编辑:程序博客网 时间:2024/06/11 14:04
using UnityEngine;
using System.Collections;


public class textFTest : MonoBehaviour {


// Use this for initialization
string editShow;
string editName;
string editPass;
void Start () {
editShow = "请输入正确的登陆名和密码";
editName = "请输入用户名";
editPass = "";
// editPass = "请输入密码:";
}

// Update is called once per frame
void Update () {

}


void  OnGUI(){
GUI.Label (new Rect (10, 10, Screen.width, 30), editShow);
if (GUI.Button (new Rect (10, 130, 50, 30), "登录")) {
editShow = "您输入的用户名是"+editName+"输入的密码是"+editPass;
}
GUI.Label (new Rect (10, 50, 50, 30), "用户名");
GUI.Label (new Rect (10, 80, 50, 30), "密码");
editName = GUI.TextField (new Rect (70, 50, 200, 30), editName, 15);
editPass = GUI.PasswordField (new Rect (70, 80, 200, 30), editPass, "*"[0], 15);
}
}
0 0
原创粉丝点击