Class Index | File Index

Classes


Class cc.DrawingPrimitiveCanvas


Extends cc.DrawingPrimitive.

Defined in: CCDrawingPrimitives.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Canvas of DrawingPrimitive implement version
Method Summary
Method Attributes Method Name and Description
 
drawCardinalSpline(config, tension, segments)
draw a cardinal spline path
 
drawCatmullRom(points, segments)
draw a CatmullRom curve
 
drawCircle(center, radius, angle, segments, drawLineToCenter)
draws a circle given the center, radius and number of segments.
 
drawColorBall(ctx, radius, color)
draw a color ball
 
drawCubicBezier(origin, control1, control2, destination, segments)
draws a cubic bezier path
 
drawImage(image, sourcePoint, sourceSize, destPoint, destSize)
draw an image
 
drawLine(origin, destination)
draws a line given the origin and destination point measured in points
 
drawPoint(point, size)
draws a point given x and y coordinate measured in points
 
drawPoints(points, numberOfPoints, size)
draws an array of points.
 
drawPoly(vertices, numOfVertices, closePolygon, fill)
draws a poligon given a pointer to cc.Point coordiantes and the number of vertices measured in points.
 
drawQuadBezier(origin, control, destination, segments)
draws a quad bezier path
 
drawStar(ctx, radius, color)
draw a star
 
fillText(strText, x, y)
fill text
Methods borrowed from class cc.DrawingPrimitive:
ctor, getRenderContext, setRenderContext
Class Detail
cc.DrawingPrimitiveCanvas()
Canvas of DrawingPrimitive implement version
Method Detail
drawCardinalSpline(config, tension, segments)
draw a cardinal spline path
Parameters:
{cc.PointArray} config
{Number} tension
{Number} segments

drawCatmullRom(points, segments)
draw a CatmullRom curve
Parameters:
{cc.PointArray} points
{Number} segments

drawCircle(center, radius, angle, segments, drawLineToCenter)
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

drawColorBall(ctx, radius, color)
draw a color ball
Parameters:
{CanvasContext} ctx
canvas context
{Number} radius
{cc.Color3B|cc.Color4B|cc.Color4F} color

drawCubicBezier(origin, control1, control2, destination, segments)
draws a cubic bezier path
Parameters:
{cc.Point} origin
{cc.Point} control1
{cc.Point} control2
{cc.Point} destination
{Number} segments

drawImage(image, sourcePoint, sourceSize, destPoint, destSize)
draw an image
Parameters:
{HTMLImageElement|HTMLCanvasElement} image
{cc.Point} sourcePoint
{cc.Size} sourceSize
{cc.Point} destPoint
{cc.Size} destSize

drawLine(origin, destination)
draws a line given the origin and destination point measured in points
Parameters:
{cc.Point} origin
{cc.Point} destination

drawPoint(point, size)
draws a point given x and y coordinate measured in points
Parameters:
{cc.Point} point
size

drawPoints(points, numberOfPoints, size)
draws an array of points.
Parameters:
{Array} points
point of array
{Number} numberOfPoints
size

drawPoly(vertices, numOfVertices, closePolygon, fill)
draws a poligon given a pointer to cc.Point coordiantes and the number of vertices measured in points.
Parameters:
{Array} vertices
a pointer to cc.Point coordiantes
{Number} numOfVertices
the number of vertices measured in points
{Boolean} closePolygon
The polygon can be closed or open
{Boolean} fill
The polygon can be closed or open and optionally filled with current color

drawQuadBezier(origin, control, destination, segments)
draws a quad bezier path
Parameters:
{cc.Point} origin
{cc.Point} control
{cc.Point} destination
{Number} segments

drawStar(ctx, radius, color)
draw a star
Parameters:
{CanvasContext} ctx
canvas context
{Number} radius
{cc.Color3B|cc.Color4B|cc.Color4F} color

fillText(strText, x, y)
fill text
Parameters:
{String} strText
{Number} x
{Number} y

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:50 GMT-0800 (PST)