Class cc.DrawNodeCanvas
- Defined in: CCDrawNode.js
- Extends cc.Node
Constructor Attributes | Constructor Name and Description |
---|---|
CCDrawNode for Canvas |
Method Summary
Class Detail
cc.DrawNodeCanvas()
CCDrawNode for Canvas
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.
-
drawCardinalSpline(config, tension, segments, lineWidth, color)draw a cardinal spline path
- Parameters:
- {Array} config
- {Number} tension
- {Number} segments
- {Number} lineWidth
- {cc.Color4F} color
-
drawCatmullRom(points, segments, lineWidth, color)draw a CatmullRom curve
- Parameters:
- {Array} points
- {Number} segments
- {Number} lineWidth
- {cc.Color4F} color
-
drawCircle(center, radius, angle, segments, drawLineToCenter, lineWidth, color)draws a circle given the center, radius and number of segments.
- Parameters:
- {cc.Point} center
- center of circle
- {Number} radius
- {Number} angle
- angle in radians
- {Number} segments
- {Boolean} drawLineToCenter
- {Number} lineWidth
- {cc.Color4F} color
-
drawCubicBezier(origin, control1, control2, destination, segments, lineWidth, color)draws a cubic bezier path
- Parameters:
- {cc.Point} origin
- {cc.Point} control1
- {cc.Point} control2
- {cc.Point} destination
- {Number} segments
- {Number} lineWidth
- {cc.Color4F} color
-
drawDot(pos, radius, color)draw a dot at a position, with a given radius and color
- Parameters:
- {cc.Point} pos
- {Number} radius
- {cc.Color4F} color
-
drawPoly(verts, fillColor, lineWidth, color)draw a polygon with a fill color and line color, copying the vertex list
- Parameters:
- {Array} verts
- {cc.Color4F} fillColor
- {Number} lineWidth
- {cc.Color4F} color
-
drawPoly_(verts, fillColor, lineWidth, color)draw a polygon with a fill color and line color without copying the vertex list
- Parameters:
- {Array} verts
- {cc.Color4F} fillColor
- {Number} lineWidth
- {cc.Color4F} color
-
drawQuadBezier(origin, control, destination, segments, lineWidth, color)draws a quad bezier path
- Parameters:
- {cc.Point} origin
- {cc.Point} control
- {cc.Point} destination
- {Number} segments
- {Number} lineWidth
- {cc.Color4F} color
-
drawRect(origin, destination, fillColor, lineWidth, lineColor)draws a rectangle given the origin and destination point measured in points.
- Parameters:
- {cc.Point} origin
- {cc.Point} destination
- {cc.Color4F} fillColor
- {Number} lineWidth
- {cc.Color4F} lineColor
-
drawSegment(from, to, lineWidth, color)draw a segment with a radius and color
- Parameters:
- {cc.Point} from
- {cc.Point} to
- {Number} lineWidth
- {cc.Color4F} color
-
{cc.Color4F} getDrawColor()draw color getter
- Returns:
- {cc.Color4F}
-
{Number} getLineWidth()line width getter
- Returns:
- {Number}
-
setDrawColor(color)draw color setter
- Parameters:
- {cc.Color4F} color
-
setLineWidth(width)line width setter
- Parameters:
- {Number} width