![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <Foundation/Foundation.h>
#import "ccTypes.h"
#import "ccMacros.h"
#import <CoreGraphics/CGGeometry.h>
Functions | |
void | ccDrawInit (void) |
void | ccDrawFree (void) |
void | ccDrawPoint (CGPoint point) |
void | ccDrawPoints (const CGPoint *points, NSUInteger numberOfPoints) |
void | ccDrawLine (CGPoint origin, CGPoint destination) |
void | ccDrawRect (CGPoint origin, CGPoint destination) |
void | ccDrawSolidRect (CGPoint origin, CGPoint destination, ccColor4F color) |
void | ccDrawPoly (const CGPoint *vertices, NSUInteger numOfVertices, BOOL closePolygon) |
void | ccDrawSolidPoly (const CGPoint *poli, NSUInteger numberOfPoints, ccColor4F color) |
void | ccDrawCircle (CGPoint center, float radius, float angle, NSUInteger segments, BOOL drawLineToCenter) |
void | ccDrawQuadBezier (CGPoint origin, CGPoint control, CGPoint destination, NSUInteger segments) |
void | ccDrawCubicBezier (CGPoint origin, CGPoint control1, CGPoint control2, CGPoint destination, NSUInteger segments) |
void | ccDrawCatmullRom (CCPointArray *arrayOfControlPoints, NSUInteger segments) |
void | ccDrawCardinalSpline (CCPointArray *config, CGFloat tension, NSUInteger segments) |
void | ccDrawColor4B (GLubyte r, GLubyte g, GLubyte b, GLubyte a) |
void | ccDrawColor4F (GLfloat r, GLfloat g, GLfloat b, GLfloat a) |
void | ccPointSize (GLfloat pointSize) |
Drawing OpenGL ES primitives.
You can change the color, point size, width by calling:
void ccDrawCardinalSpline | ( | CCPointArray * | config, |
CGFloat | tension, | ||
NSUInteger | segments | ||
) |
draws a Cardinal Spline path.
void ccDrawCatmullRom | ( | CCPointArray * | arrayOfControlPoints, |
NSUInteger | segments | ||
) |
draws a Catmull Rom path.
void ccDrawCircle | ( | CGPoint | center, |
float | radius, | ||
float | angle, | ||
NSUInteger | segments, | ||
BOOL | drawLineToCenter | ||
) |
draws a circle given the center, radius and number of segments measured in points
void ccDrawColor4B | ( | GLubyte | r, |
GLubyte | g, | ||
GLubyte | b, | ||
GLubyte | a | ||
) |
set the drawing color with 4 unsigned bytes
void ccDrawColor4F | ( | GLfloat | r, |
GLfloat | g, | ||
GLfloat | b, | ||
GLfloat | a | ||
) |
set the drawing color with 4 floats
void ccDrawCubicBezier | ( | CGPoint | origin, |
CGPoint | control1, | ||
CGPoint | control2, | ||
CGPoint | destination, | ||
NSUInteger | segments | ||
) |
draws a cubic bezier path measured in points.
void ccDrawFree | ( | void | ) |
Frees allocated resources by the drawing primitives
void ccDrawInit | ( | void | ) |
Initializes the drawing primitives
void ccDrawLine | ( | CGPoint | origin, |
CGPoint | destination | ||
) |
draws a line given the origin and destination point measured in points.
void ccDrawPoint | ( | CGPoint | point | ) |
draws a point given x and y coordinate measured in points.
void ccDrawPoints | ( | const CGPoint * | points, |
NSUInteger | numberOfPoints | ||
) |
draws an array of points.
void ccDrawPoly | ( | const CGPoint * | vertices, |
NSUInteger | numOfVertices, | ||
BOOL | closePolygon | ||
) |
draws a polygon given a pointer to CGPoint coordinates and the number of vertices measured in points. The polygon can be closed or open
void ccDrawQuadBezier | ( | CGPoint | origin, |
CGPoint | control, | ||
CGPoint | destination, | ||
NSUInteger | segments | ||
) |
draws a quad bezier path measured in points.
void ccDrawRect | ( | CGPoint | origin, |
CGPoint | destination | ||
) |
draws a rectangle given the origin and destination point measured in points.
void ccDrawSolidPoly | ( | const CGPoint * | poli, |
NSUInteger | numberOfPoints, | ||
ccColor4F | color | ||
) |
draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
void ccDrawSolidRect | ( | CGPoint | origin, |
CGPoint | destination, | ||
ccColor4F | color | ||
) |
draws a solid rectangle given the origin and destination point measured in points.
void ccPointSize | ( | GLfloat | pointSize | ) |
set the point size in points. Default 1.