zoukankan      html  css  js  c++  java
  • unity3d之GUI

    1.Button

    1  void OnGUI()
    2     {
    3         if (GUI.Button(new Rect(80, 80, 50, 20), "up"))
    4         {flg=true; }
    5         if (GUI.Button(new Rect(80, 120, 50, 20), "down"))
    6         {flg=false; }
    7         if (GUI.Button(new Rect(140, 100, 50, 20), "change"))
    8         {flgChange=!flgChange; }
    9     }

    2.密码登陆

     1   void OnGUI()
     2     { 
     3         GUI.Label(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 50, 50, 20), "ACCOUNT");
     4         userName = GUI.TextField(new Rect(Screen.width / 2 - 40, Screen.height / 2 - 50, 100, 20), userName, 15);//15为最大字符串长度  
     5         //密码  
     6         GUI.Label(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 20, 50, 20), "PASSWORD");
     7         userPassword = GUI.PasswordField(new Rect(Screen.width / 2 - 40, Screen.height / 2 - 20, 100, 20), userPassword, '*');//'*'为密码遮罩  
     8         //信息  
     9         GUI.Label(new Rect(Screen.width / 2 - 100, Screen.height / 2 + 30, 100, 20), info);
    10         //登录按钮  
    11         /* if (GUI.Button(new Rect(80, 80, 50, 20), "登录"))
    12          {
    13              if (userName == "zuoyamin" && userPassword == "123")
    14              {
    15                  info = "登录成功!";
    16              }
    17              else
    18              {
    19                  info = "登录失败!";
    20              }
    21          }*/
    22 }
  • 相关阅读:
    EasyUI
    intellij idea打包maven项目
    struts2框架详解
    java电子书
    查看mysql安装路径
    springboot 集成 vue
    C#中的属性
    C#中的时间戳
    int.TryParse非预期执行引发的思考
    IQueryable 和 IEnumerable 的区别
  • 原文地址:https://www.cnblogs.com/eniac1946/p/7280390.html
Copyright © 2011-2022 走看看