Class cc.DrawNode
- Defined in: CCDrawNode.js
- Extends cc.Node
Constructor Attributes | Constructor Name and Description |
---|---|
CCDrawNode |
Method Summary
Class Detail
cc.DrawNode()
CCDrawNode
Node that draws dots, segments and polygons.
Faster than the "drawing primitives" since they it draws everything in one single batch.
Method Detail
-
clear()Clear the geometry in the node's buffer.
-
Creates a DrawNode
- Returns:
- {cc.DrawNode}
-
drawCardinalSpline(config, tension, segments, lineWidth, color)draw a cardinal spline path
- Parameters:
- {Array} config
- {Number} tension
- {Number} segments
- {Number} lineWidth
- {cc.Color} color
-
drawCatmullRom(points, segments, lineWidth, color)draw a CatmullRom curve
- Parameters:
- {Array} points
- {Number} segments
- {Number} lineWidth
- {cc.Color} color
-
drawCircle(center, radius, angle, segments, drawLineToCenter, lineWidth, color)draws a circle given the center, radius and number of segments.
-
drawCubicBezier(origin, control1, control2, destination, segments, lineWidth, color)draws a cubic bezier path
-
drawDot(pos, radius, color)draw a dot at a position, with a given radius and color
-
drawPoly(verts, fillColor, lineWidth, color)draw a polygon with a fill color and line color, copying the vertex list
-
drawPoly_(verts, fillColor, lineWidth, color)draw a polygon with a fill color and line color without copying the vertex list
-
drawQuadBezier(origin, control, destination, segments, lineWidth, color)draws a quad bezier path
-
drawRect(origin, destination, fillColor, lineWidth, lineColor)draws a rectangle given the origin and destination point measured in points.
-
drawSegment(from, to, lineWidth, color)draw a segment with a radius and color
-
{cc.Color} getDrawColor()draw color getter
- Returns:
- {cc.Color}
-
{Number} getLineWidth()line width getter
- Returns:
- {Number}
-
setDrawColor(color)draw color setter
- Parameters:
- {cc.Color} color
-
setLineWidth(width)line width setter
- Parameters:
- {Number} width