[]鼠标事件:为什么没有设置穿透,也会发生穿透现象?
public function createMovieClip():void {
bg = CreateObj.createSprite(McUrlMgr.LOAD_BG_Path);
this.addChild(bg);
bg.x = 0;
bg.y = 0;
var bg2:Sprite = CreateObj.createSprite(McUrlMgr.LOAD_BG_Path);
bg2.x = 0;
bg2.y = 0;
this.addChild(bg2);
bg2.on(laya.events.Event.MOUSE_DOWN,this,test);
}
==================
public static function createSprite(url:String,c:Boolean = false):Sprite {
var sp:Sprite = new Sprite();
sp.loadImage(url);
return sp;
}
bg和bg2一样大,bg盖在bg2上,无论对bg或者是bg2添加事件,都会触发监听。为什么...= =!懵了。
bg = CreateObj.createSprite(McUrlMgr.LOAD_BG_Path);
this.addChild(bg);
bg.x = 0;
bg.y = 0;
var bg2:Sprite = CreateObj.createSprite(McUrlMgr.LOAD_BG_Path);
bg2.x = 0;
bg2.y = 0;
this.addChild(bg2);
bg2.on(laya.events.Event.MOUSE_DOWN,this,test);
}
==================
public static function createSprite(url:String,c:Boolean = false):Sprite {
var sp:Sprite = new Sprite();
sp.loadImage(url);
return sp;
}
bg和bg2一样大,bg盖在bg2上,无论对bg或者是bg2添加事件,都会触发监听。为什么...= =!懵了。
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Laya_XS
赞同来自: Sean8023