[code]pos0:Laya.Point=new Laya.Point();
pos1:Laya.Point=new Laya.Point();
__mouseDown(e:Event){
this.pos0.x=this.bmp.mouseX;
this.pos0.y=this.bmp.mouseY;
this.pos1.x=this.bmp.mouseX
this.pos1.y=this.bmp.mouseY;
this.bmp.on(Laya.Event.MOUSE_MOVE, this, this.__mouseMove);
this.bmp.on(Laya.Event.MOUSE_UP, this, this.__mouseUp);
console.log(this.pos0.x);
}
__mouseMove(e:Event){
this.pos1.x=this.bmp.mouseX
this.pos1.y=this.bmp.mouseY;
if(Utils3D.getThis.getDistance(this.pos0,this.pos1)>10){
this.bmp.graphics.drawLine(this.pos0.x,this.pos0.y,this.pos1.x,this.pos1.y,"#ff0000",5);
this.pos0.x=this.bmp.mouseX;
this.pos0.y=this.bmp.mouseY;
}
}
__mouseUp(e:Event){
this.bmp.off(Laya.Event.MOUSE_MOVE, this, this.__mouseMove);
this.bmp.off(Laya.Event.MOUSE_UP, this, this.__mouseUp);
this.bmp.graphics.drawLine(this.pos0.x,this.pos0.y,this.pos1.x,this.pos1.y,"#ff0000",5);
}[/code]