你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
cuixueying
赞同来自:
liso009
dnvqqk
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); }
要回复问题请先登录
3 个回复
cuixueying
赞同来自:
建议:不要使用layaAir绘制矢量图的方式进行大量的矢量图绘制,这样drawCall会剧增,项目会很卡!
liso009
赞同来自:
dnvqqk
赞同来自: