[LayaAirIDE 1.0]鼠标 MOUSE_DOWN Event 回来的信息不符合
为什么回来的是 “mouseout” 而不是 "mousedown" ?
代码如下:
function createSprite() {
picture = new Sprite();
picture.loadImage(picturePath);
Laya.stage.addChild(picture);
var texture = Laya.loader.getRes(picturePath);
picturePath.pivot(texture.width / 2, texture.height / 2);
picture.x = Laya.stage.width / 2;
picture.y = Laya.stage.height / 2;
picture.scale(cardScaleValue, cardScaleValue, true);
picture.on(Event.MOUSE_DOWN, this, onStartPicture(Picture);
}
function onStartDragPicture(e) {
console.log('onStartDragPicture e', e);
}
返回的信息:
Event
_stoped: false
currentTarget: Stage {focus: null, designWidth: 1307, designHeight: 758, canvasRotation: false, canvasDegree: 0, …}
nativeEvent: MouseEvent {isTrusted: true, screenX: 906, screenY: 460, clientX: 457, clientY: 278, …}
target: Stage {focus: null, designWidth: 1307, designHeight: 758, canvasRotation: false, canvasDegree: 0, …}
touchId: 0
type: "mouseout"
代码如下:
function createSprite() {
picture = new Sprite();
picture.loadImage(picturePath);
Laya.stage.addChild(picture);
var texture = Laya.loader.getRes(picturePath);
picturePath.pivot(texture.width / 2, texture.height / 2);
picture.x = Laya.stage.width / 2;
picture.y = Laya.stage.height / 2;
picture.scale(cardScaleValue, cardScaleValue, true);
picture.on(Event.MOUSE_DOWN, this, onStartPicture(Picture);
}
function onStartDragPicture(e) {
console.log('onStartDragPicture e', e);
}
返回的信息:
Event
_stoped: false
currentTarget: Stage {focus: null, designWidth: 1307, designHeight: 758, canvasRotation: false, canvasDegree: 0, …}
nativeEvent: MouseEvent {isTrusted: true, screenX: 906, screenY: 460, clientX: 457, clientY: 278, …}
target: Stage {focus: null, designWidth: 1307, designHeight: 758, canvasRotation: false, canvasDegree: 0, …}
touchId: 0
type: "mouseout"
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Luren_yi
赞同来自:
123黄
赞同来自:
里面请加个图
在这里
let ApePath = "res/monkey.png";