cc.DrawingPrimitiveCanvas/cc.DrawingPrimitiveWebGL More...
Functions | |
| void | init () |
| Initializes the drawing primitives. More... | |
| void | free () |
| Frees allocated resources by the drawing primitives. More... | |
| void | drawPoint (const Vec2 &point) |
| Draws a point given x and y coordinate measured in points. More... | |
| void | drawPoints (const Vec2 *points, unsigned int numberOfPoints) |
| Draws an array of points. More... | |
| void | drawLine (const Vec2 &origin, const Vec2 &destination) |
| Draws a line given the origin and destination point measured in points. More... | |
| void | drawRect (Vec2 origin, Vec2 destination) |
| Draws a rectangle given the origin and destination point measured in points. More... | |
| void | drawSolidRect (Vec2 origin, Vec2 destination, Color4F color) |
| Draws a solid rectangle given the origin and destination point measured in points. More... | |
| void | drawPoly (const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon) |
| Draws a polygon given a pointer to point coordinates and the number of vertices measured in points. More... | |
| void | drawSolidPoly (const Vec2 *poli, unsigned int numberOfPoints, Color4F color) |
| Draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color. More... | |
| void | drawCircle (const Vec2 ¢er, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY) |
| Draws a circle given the center, radius and number of segments. More... | |
| void | drawCircle (const Vec2 ¢er, float radius, float angle, unsigned int segments, bool drawLineToCenter) |
| Draws a circle given the center, radius and number of segments. More... | |
| void | drawSolidCircle (const Vec2 ¢er, float radius, float angle, unsigned int segments, float scaleX, float scaleY) |
| Draws a solid circle given the center, radius and number of segments. More... | |
| void | drawSolidCircle (const Vec2 ¢er, float radius, float angle, unsigned int segments) |
| Draws a solid circle given the center, radius and number of segments. More... | |
| void | drawQuadBezier (const Vec2 &origin, const Vec2 &control, const Vec2 &destination, unsigned int segments) |
| Draws a quad bezier path. More... | |
| void | drawCubicBezier (const Vec2 &origin, const Vec2 &control1, const Vec2 &control2, const Vec2 &destination, unsigned int segments) |
| Draws a cubic bezier path. More... | |
| void | drawCatmullRom (PointArray *arrayOfControlPoints, unsigned int segments) |
| Draws a Catmull Rom path. More... | |
| void | drawCardinalSpline (PointArray *config, float tension, unsigned int segments) |
| Draws a Cardinal Spline path. More... | |
| void | setDrawColor4B (GLubyte r, GLubyte g, GLubyte b, GLubyte a) |
| Set the drawing color with 4 unsigned bytes. More... | |
| void | setDrawColor4F (GLfloat r, GLfloat g, GLfloat b, GLfloat a) |
| Set the drawing color with 4 floats. More... | |
| void | setPointSize (GLfloat pointSize) |
| Set the point size in points. More... | |
cc.DrawingPrimitiveCanvas/cc.DrawingPrimitiveWebGL
| void cocos2d::DrawPrimitives::init | ( | ) |
Initializes the drawing primitives.
NA
| void cocos2d::DrawPrimitives::free | ( | ) |
Frees allocated resources by the drawing primitives.
NA
| void cocos2d::DrawPrimitives::drawPoint | ( | const Vec2 & | point | ) |
Draws a point given x and y coordinate measured in points.
| point | A Vec2 with a point given x and y coordinate. |
| void cocos2d::DrawPrimitives::drawPoints | ( | const Vec2 * | points, |
| unsigned int | numberOfPoints | ||
| ) |
Draws an array of points.
| points | A point coordinates. |
| numberOfPoints | The number of points. |
Draws a rectangle given the origin and destination point measured in points.
The origin and the destination can not have the same x and y coordinate.
| origin | The rectangle origin. |
| destination | The rectangle destination. |
Draws a solid rectangle given the origin and destination point measured in points.
The origin and the destination can not have the same x and y coordinate.
| origin | The rectangle origin. |
| destination | The rectangle destination. |
| color | The rectangle color. |
| void cocos2d::DrawPrimitives::drawPoly | ( | const Vec2 * | vertices, |
| unsigned int | numOfVertices, | ||
| bool | closePolygon | ||
| ) |
Draws a polygon given a pointer to point coordinates and the number of vertices measured in points.
The polygon can be closed or open.
| vertices | A pointer to point coordinates. |
| numOfVertices | The number of vertices measured in points. |
| closePolygon | The polygon can be closed or open. |
| void cocos2d::DrawPrimitives::drawSolidPoly | ( | const Vec2 * | poli, |
| unsigned int | numberOfPoints, | ||
| Color4F | color | ||
| ) |
Draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
| poli | A solid polygon given a pointer to CGPoint coordinates. |
| numberOfPoints | The number of vertices measured in points. |
| color | The solid polygon color. |
| void cocos2d::DrawPrimitives::drawCircle | ( | const Vec2 & | center, |
| float | radius, | ||
| float | angle, | ||
| unsigned int | segments, | ||
| bool | drawLineToCenter, | ||
| float | scaleX, | ||
| float | scaleY | ||
| ) |
Draws a circle given the center, radius and number of segments.
| center | The circle center point. |
| radius | The circle rotate of radius. |
| angle | The circle angle. |
| segments | The number of segments. |
| drawLineToCenter | Whether or not draw the line from the origin to center. |
| scaleX | The scale value in x. |
| scaleY | The scale value in y. |
| void cocos2d::DrawPrimitives::drawCircle | ( | const Vec2 & | center, |
| float | radius, | ||
| float | angle, | ||
| unsigned int | segments, | ||
| bool | drawLineToCenter | ||
| ) |
Draws a circle given the center, radius and number of segments.
| center | The circle center point. |
| radius | The circle rotate of radius. |
| angle | The circle angle. |
| segments | The number of segments. |
| drawLineToCenter | Whether or not draw the line from the origin to center. |
| void cocos2d::DrawPrimitives::drawSolidCircle | ( | const Vec2 & | center, |
| float | radius, | ||
| float | angle, | ||
| unsigned int | segments, | ||
| float | scaleX, | ||
| float | scaleY | ||
| ) |
Draws a solid circle given the center, radius and number of segments.
| center | The circle center point. |
| radius | The circle rotate of radius. |
| angle | The circle angle. |
| segments | The number of segments. |
| scaleX | The scale value in x. |
| scaleY | The scale value in y. NA |
| void cocos2d::DrawPrimitives::drawSolidCircle | ( | const Vec2 & | center, |
| float | radius, | ||
| float | angle, | ||
| unsigned int | segments | ||
| ) |
Draws a solid circle given the center, radius and number of segments.
| center | The circle center point. |
| radius | The circle rotate of radius. |
| angle | The circle angle. |
| segments | The number of segments. NA |
| void cocos2d::DrawPrimitives::drawQuadBezier | ( | const Vec2 & | origin, |
| const Vec2 & | control, | ||
| const Vec2 & | destination, | ||
| unsigned int | segments | ||
| ) |
Draws a quad bezier path.
| origin | The origin of the bezier path. |
| control | The control of the bezier path. |
| destination | The destination of the bezier path. |
| segments | The number of segments. |
| void cocos2d::DrawPrimitives::drawCubicBezier | ( | const Vec2 & | origin, |
| const Vec2 & | control1, | ||
| const Vec2 & | control2, | ||
| const Vec2 & | destination, | ||
| unsigned int | segments | ||
| ) |
Draws a cubic bezier path.
| origin | The origin of the bezier path. |
| control1 | The first control of the bezier path. |
| control2 | The second control of the bezier path. |
| destination | The destination of the bezier path. |
| segments | The number of segments. |
| void cocos2d::DrawPrimitives::drawCatmullRom | ( | PointArray * | arrayOfControlPoints, |
| unsigned int | segments | ||
| ) |
Draws a Catmull Rom path.
| arrayOfControlPoints | A point array of control point. |
| segments | The number of segments. |
| void cocos2d::DrawPrimitives::drawCardinalSpline | ( | PointArray * | config, |
| float | tension, | ||
| unsigned int | segments | ||
| ) |
Draws a Cardinal Spline path.
| config | A array point. |
| tension | The tension of the spline. |
| segments | The number of segments. |
| void cocos2d::DrawPrimitives::setDrawColor4B | ( | GLubyte | r, |
| GLubyte | g, | ||
| GLubyte | b, | ||
| GLubyte | a | ||
| ) |
Set the drawing color with 4 unsigned bytes.
| r | The red color with a unsigned bytes. |
| g | The green color with a unsigned bytes. |
| b | The blue color with a unsigned bytes. |
| a | Alpha with a unsigned bytes. |
| void cocos2d::DrawPrimitives::setDrawColor4F | ( | GLfloat | r, |
| GLfloat | g, | ||
| GLfloat | b, | ||
| GLfloat | a | ||
| ) |
Set the drawing color with 4 floats.
| r | The red color with an floats. |
| g | The green color with an floats. |
| b | The blue color with an floats. |
| a | Alpha with an floats. |
| void cocos2d::DrawPrimitives::setPointSize | ( | GLfloat | pointSize | ) |
Set the point size in points.
Default 1.
| pointSize | The point size with an float. |