[]点击区域问题


var con1:laya.display.Sprite = new laya.display.Sprite;
Laya.stage.addChild(con1);
con1.x = con1.y = 100;
var con:laya.display.Sprite = new laya.display.Sprite;
con1.addChild(con);
// con.scrollRect = new laya.maths.Rectangle(200,200,500,500);
con.x = con.y = -200;
var sp:laya.display.Sprite = new laya.display.Sprite;
con.addChild(sp);
sp.x = 250;
sp.y = 300;
sp.graphics.drawRect(-50,-100,100,100,"#ff0000");
sp.hitArea = new laya.maths.Rectangle(-50,-100,100,100);
sp.on(laya.events.Event.CLICK,this,this.spHandler);
function spHandler()
{
    sp.graphics.clear();
    var rc:number = Math.floor(Math.random()*0xffffff);
    sp.graphics.drawRect(-50,-100,100,100,"#"+rc);
}
这样多包几层,点击区域就会怪怪的,绘制的区域和点击区域不一样,不知道是不是我理解的有问题
已邀请:

要回复问题请先

商务合作
商务合作