當前位置:
首頁 >
Cocos画线
發布時間:2023/12/14
33
豆豆
self.drawNode=cc.DrawNode:create() --畫線功能self:addChild(self.drawNode,5)--self.drawNode:drawLine(cc.p(50,500), cc.p(950,450), cc.c4f(1,0,0,1))
self.drawNode:clear() --清理--self.drawNode:drawLine(cc.p(x+25,y+25), cc.p(300,430), cc.c4f(1,0,0,1)) --step--self.drawNode:drawLine(cc.p(x+25,y+25), cc.p(270,110), cc.c4f(1,0,0,1)) --step--self.drawNode:drawLine(cc.p(x+25,y+25), cc.p(720,80), cc.c4f(1,0,0,1)) --step--self.drawNode:drawLine(cc.p(x+25,y+25), cc.p(690,340), cc.c4f(1,0,0,1)) --step
總結