new
cc.DrawNode()创建draw对象,画点,线段,多边形
var
drawNode=
cc.DrawNode();
this
.addChild(drawNode);
//加入Layer层
drawNode.clear()
//清除节点缓存
drawNode.ctor()
//构造函数
drawNode.drawCardinalSpline(config,tension,segments,lineWidth,color)
//曲线
//参数说明:
//congfig:点数组
//tension:张力
//segments:段落
//lineWidth:线条宽度
//color:颜色
drawNode.drawCatmullRom(points,0)!important">//同上
drawNode.drawCircle(center,radius,angle,drawLineToCenter,0)!important">//画圆
//参数说明:原点,半径,弧度,分段(越大越接近圆),原点到弧度的线(boolean),线条宽度,颜色
drawNode.drawCubicBezier(origin,control1,control2,destination,0)!important">//画三次贝塞尔曲线
//drawNode.drawCubicBezier(cc.p(s.width-250,40),cc.p(s.width-70,100),cc.p(s.width-30,250),cc.p(s.width-10,s.height-50),10,1,cc.color(0,1));
drawNode.drawQuadBezier(origin,control,0)!important">//画二次贝塞尔曲线参考三次贝塞尔曲线
drawNode.drawDot(pos,0)!important">//画点
//drawNode.drawDot(cc.p(60,20,cc.color(0.5,0.6,1));
drawNode.drawDots(points,0)!important">//画点points点数组
drawNode.drawPoly(verts,fillColor,0)!important">//画多边形
drawNode.drawRect(origin,lineColor)
//画矩形
drawNode.drawSegment(from,to,color)