|
GUI:手工绘制坐标问题解决,但是无法取到控件里的值,添加的控件可以取值,详情见瑞子的贴
弹窗代码如下:- var btntexture:Texture;
- var cls:boolean=false;
- var stringToEdit : String = "Hello World";
- var xx = Rect (100, 100, 400, 250);
- function Update () {
- }
- function OnGUI()
- {
-
- GUI.Window(0, Rect(Screen.width-110, 100, 120, 220 ), windowF, "Menu");
- if(cls)
- xx = GUI.Window(1, xx, windowreg, "Register Window");
- }
- function windowF()
- {
- if(GUILayout.Button("REG"))
- cls = true;
- }
- function windowreg(windowID:int){
- GUILayout.BeginArea(Rect(0,0,400,250));
- stringToEdit = GUI.TextField (Rect (50, 20, 200, 20), stringToEdit, 25);
- if(GUI.Button(Rect(100, 210,80,30),"Test1"))
- print("Test");
- if(GUI.Button(Rect(200,210,80,30),"Submit"))
- print("Submit successed");
-
- GUILayout.EndArea();
- GUI.DragWindow();
- }
复制代码 |
|