Unity3D中GUI窗体的移动
来源:互联网 发布:知乎开放注册时间 编辑:程序博客网 时间:2024/06/05 09:31
unity3D更多资源教程免费下载,群193521697 邀请码:10026.(有问题找管理员)
01
//设定拖曳视窗大小
02
03
var windowRect : Rect = Rect (20,20, 120, 50);
04
05
//限制可移动范围
06
07
var constrain : Rect;
08
09
//滑鼠座标
10
11
private var e : Event;
12
13
function OnGUI () {
14
15
//取得滑鼠座标
16
17
e = Event.current;
18
19
//显示范围用,可有可无
20
21
GUI.Box(constrain, “Drag Here”);
22
23
windowRect = GUI.Window(0, windowRect, DoMyWindow, “My Window”);
24
25
}
26
27
function DoMyWindow (windowID : int){
28
29
//限制可移动范围
30
31
if(e.mousePosition.x> constrain.x&& e.mousePosition.x< (constrain.width+ constrain.x)&& e.mousePosition.y> constrain.y&& e.mousePosition.y< (constrain.height+ constrain.y)){
32
33
GUI.DragWindow(Rect (0,0,10000, 20));
34
35
}
36
37
}
- Unity3D中GUI窗体的移动
- unity3d中GUI 密码框的显示
- Unity3D C#中GUI.TextField的传递
- Unity3D:GUI的绘制
- winform中自定义的窗体移动代码
- Java GUI中改变窗体的背影图片
- Unity3D中物体的移动方式
- Unity3D中物体的移动方式
- unity3d 中实现物体的移动
- Unity3D中创建滑动GUI
- Unity3D高版本中如何进行GUI Texture的设置
- 可以拖动的GUI窗体
- GUI窗体中通过按钮改变窗体下部的内容解决方案
- [Unity3D]Unity3d的GUI排版教程-1
- [ Unity3d] Unity3d的GUI排版教程-2
- [Unity3D]Unity3d的GUI排版教程-3
- [Unity3D] Unity3d的GUI排版教程-4
- Unity3d的GUI排版教程
- 第五章——u-boot源码启动流程
- C/C++中 变量的存储位置
- dedecms 修改问答模块标题 多个ul输出 dede调取友情链接
- java 基础 反射,自动装配实体
- Python3基础(四) 条件与循环控制
- Unity3D中GUI窗体的移动
- UVA 10098 Generating Fast, Sorted Permutation(全排列)
- LeeCode-Remove Duplicates from Sorted Array II
- hd 2178 猜数字
- 设计模式——组合设计模式
- js捕获回车事件
- 【2014】最新处理硬盘物理坏道方法教程
- B. Little Pony and Sort by Shift
- Unity3D NGUI按钮背景转换