在Demo_Drag&Drop中的疑问..
这里的rect.x 的值是在控制器索引0时的位置坐标, 代码运行到此处控制器索引应该是在1, rect的x坐标却是在舞台外面?
Rect rect = bounds.TransformRect(new Rect(0, 0, bounds.width, bounds.height), GRoot.inst);
//---!!Because at this time the container is on the right side of the stage and beginning to move to left(transition), so we need to caculate the final position
rect.x -= obj.parent.x;
这里我用
d.dragBounds = new Rect(bounds.x, bounds.y + 70, bounds.width, bounds.height);
也是一样的效果
看了坐标系统和拖放组件的教程有点想不明白此处的原理...
Rect rect = bounds.TransformRect(new Rect(0, 0, bounds.width, bounds.height), GRoot.inst);
//---!!Because at this time the container is on the right side of the stage and beginning to move to left(transition), so we need to caculate the final position
rect.x -= obj.parent.x;
这里我用
d.dragBounds = new Rect(bounds.x, bounds.y + 70, bounds.width, bounds.height);
也是一样的效果
看了坐标系统和拖放组件的教程有点想不明白此处的原理...
没有找到相关结果
已邀请:
1 个回复
谷主
赞同来自: zxt385189027