this.graphics = this.node.getComponent(cc.Graphics);
var pointNodeArray = [cc.p(0,0),cc.p(50,50),cc.p(100,80),cc.p(100,0),cc.p(50,-50)];//
this.graphics.clear();
this.graphics.moveTo(pointNodeArray[0]);
for(var i=1; i<pointNodeArray.length; i++){
this.graphics.lineTo(pointNodeArray[i]);
}
this.graphics.strokeColor = cc.hexToColor('#097c25');
this.graphics.lineWidth = 5
this.graphics.stroke();
当调用绘制此图形,第一次正常,重复调用则之后就不会被绘制了,这种情况是我使用不当还是有bug呢?
我把clear(),去掉绘制,可以,但是当一调用clear(),清除画布后,就又再也画不上了。
求解决指导,官方文档太少了