简单GUI绘制弹窗代码
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();
} 感谢楼主分享~!!! 很不错 顶顶多好 真心顶 说的非常好 不错不错 好帖就是要顶 顶顶多好 难得一见的好帖
页:
[1]