Egret Engine 2D - 显示对象
|
|
|
|
关于位置 |
container.globalToLocal(0,0);
localToGlobal() 方法将本地坐标转换为舞台坐标。
|
|
circle.touchEnabled = true; circle.addEventListener(egret.TouchEvent.TOUCH_BEGIN,startMove,this); circle.addEventListener(egret.TouchEvent.TOUCH_END,stopMove,this); function startMove(e:egret.TouchEvent):void{ //计算手指和圆形的距离 offsetX = e.stageX - circle.x; offsetY = e.stageY - circle.y; |
平移
|
function onScroll(e: egret.TouchEvent): void { var rect: egret.Rectangle = bigText.scrollRect; switch (e.currentTarget) { case btnLeft: |
|
|