首页 unity3D技术之gui.dragwindow 拖动窗口_

unity3D技术之gui.dragwindow 拖动窗口_

举报
开通vip

unity3D技术之gui.dragwindow 拖动窗口_parameters参数 position the part of the window that can be dragged. this is clipped to the actual window. 能拖动窗口部分的位置,这是被修剪到实际窗口。 returns rect- the rectangle the window is at. 返回rect类型,窗口所在的矩形。 description描述 make a window draggable. 创建一个可拖动窗口。 insert a...

unity3D技术之gui.dragwindow 拖动窗口_
parameters参数 position the part of the window that can be dragged. this is clipped to the actual window. 能拖动窗口部分的位置,这是被修剪到实际窗口。 returns rect- the rectangle the window is at. 返回rect类型,窗口所在的矩形。 description描述 make a window draggable. 创建一个可拖动窗口。 insert a call to this function inside your window code to make a window draggable. 在你的窗口代码,插入调用到这个函数,来创建一个可拖动窗口。 c# javascript using unityengine; using system.collections; public class example :monobehaviour{ publicrectwindowrect = newrect(20, 20, 120, 50); void ongui() { windowrect =gui.window(0, windowrect, domywindow, "my window"); } void domywindow(int windowid) { gui.dragwindow(newrect(0, 0, 10000, 20)); } } var windowrect :rect=rect(20, 20, 120, 50); function ongui () { //注册一个窗口 windowrect =gui.window(0, windowrect, domywindow, "my window"); } //创建窗口内容 function domywindow (windowid : int) { //创建一个10000x20像素很长的矩形 //这样做可以你调整窗口大小而不用在修改这个值,20就是标题栏的高度,这个范围是可以拖动的 gui.dragwindow(rect(0,0, 10000, 20)); } · static functiondragwindow() : void description描述 if you want to have the entire window background to act as a drag area, use the version of dragwindow that takes no parameters and put it at the end of the window function. 如果你想将完整的窗口背景作为拖动区域,使用dragwindow不带参数的版本,放在窗口函数的末尾。 this will mean that any other controls will get precedence and the dragging will only be activated if nothing else has mouse focus. 这将意味着,任何其他控件将会得到优先,拖动将仅在如果没有别的鼠标焦点被激活。 另见:dragwindow,bringwindowtofront,bringwindowtoback c# javascript using unityengine; using system.collections; public class example :monobehaviour{ publicrectwindowrect = newrect(20, 20, 120, 50); void ongui() { windowrect =gui.window(0, windowrect, domywindow, "my window"); } void domywindow(int windowid) { gui.button(newrect(10, 20, 100, 20), "can't drag me"); gui.dragwindow(); } } var windowrect :rect=rect(20, 20, 120, 50); function ongui () { //注册一个窗口 windowrect =gui.window(0, windowrect, domywindow, "my window"); } // 制作窗口内容 function domywindow (windowid : int) { gui.button(rect(10,20,100,20), "can't drag me"); // insert a huge dragging area at the end. // this gets clipped to the window (like all other controls) so you can never drag the window from outside it. //在末尾插入一个很大的可拖动区域,这得到被修剪的窗口(像其他控件一样),因此你永远无法从外面拖动窗口。 gui.dragwindow(); *
本文档为【unity3D技术之gui.dragwindow 拖动窗口_】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_597436
暂无简介~
格式:doc
大小:18KB
软件:Word
页数:0
分类:互联网
上传时间:2019-08-24
浏览量:54