|
效果图:
1.
2.鼠标拖动窗体移动到顶端后
[code=javascript]var windowRect = Rect (0, 230, 200 , 150);
function OnGUI () {
windowRect = GUI.Window (0,Rect(0,windowRect.y,Screen.width,150), DoMyWindow, "My Window");
if (windowRect.y< -10){
windowRect = GUI.Window (0,Rect(0,-140,Screen.width,windowRect.height), DoMyWindow, "My Window");
}
}
function DoMyWindow (windowID : int) {
if(GUI.Button (Rect (10,20,100,120), "button1")){
};
if(GUI.Button (Rect (120,20,100,120), "button2")){
};
if(GUI.Button (Rect (230,20,100,120), "button3")){
};
GUI.DragWindow ();
}
function Update() {
}
[/code] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|