//注册事件
Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.onMouseEvent);
Laya.stage.on(Laya.Event.MOUSE_UP, this, this.onMouseEvent);
Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.onMouseEvent);
Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.onMouseEvent);
//鼠标yi'dong
private onMouseEvent(e: Laya.Event): void {
switch (e.type) {
case Laya.Event.MOUSE_MOVE:
this.drag.x = e.stageX;
this.drag.y = e.stageY;
console.log(e.stageY, Laya.stage.mouseY, this.drag.y, "aaaaa")
break;
}
}
视频结尾的打印906是物体的坐标,手指在Y轴:1300左右移动,只有部分机型(也就那一部XR)遇到这个bug
附件:
拖拽.zip