Functions

/Users/ricardoquesada/progs/cocos2d-iphone/cocos2d/CCDrawingPrimitives.h File Reference

#import <CoreGraphics/CGGeometry.h>
#import <objc/objc.h>
Include dependency graph for CCDrawingPrimitives.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ccDrawPoint (CGPoint point)
void ccDrawPoints (CGPoint *points, unsigned int numberOfPoints)
void ccDrawLine (CGPoint origin, CGPoint destination)
void ccDrawPoly (CGPoint *vertices, int numOfVertices, BOOL closePolygon)
void ccDrawCircle (CGPoint center, float radius, float angle, int segments, BOOL drawLineToCenter)
void ccDrawQuadBezier (CGPoint origin, CGPoint control, CGPoint destination, int segments)
void ccDrawCubicBezier (CGPoint origin, CGPoint control1, CGPoint control2, CGPoint destination, int segments)

Detailed Description

Drawing OpenGL ES primitives.

You can change the color, width and other property by calling the glColor4ub(), glLineWitdh(), glPointSize().

Warning:
These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch.

Definition in file CCDrawingPrimitives.h.


Function Documentation

void ccDrawCircle ( CGPoint  center,
float  radius,
float  angle,
int  segments,
BOOL  drawLineToCenter 
)

draws a circle given the center, radius and number of segments.

void ccDrawCubicBezier ( CGPoint  origin,
CGPoint  control1,
CGPoint  control2,
CGPoint  destination,
int  segments 
)

draws a cubic bezier path

Since:
v0.8
void ccDrawLine ( CGPoint  origin,
CGPoint  destination 
)

draws a line given the origin and destination point

void ccDrawPoint ( CGPoint  point  ) 

draws a point given x and y coordinate

void ccDrawPoints ( CGPoint *  points,
unsigned int  numberOfPoints 
)

draws an array of points.

Since:
v0.7.2
void ccDrawPoly ( CGPoint *  vertices,
int  numOfVertices,
BOOL  closePolygon 
)

draws a poligon given a pointer to CGPoint coordiantes and the number of vertices. The polygon can be closed or open

void ccDrawQuadBezier ( CGPoint  origin,
CGPoint  control,
CGPoint  destination,
int  segments 
)

draws a quad bezier path

Since:
v0.8
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

cocos2d for iPhone 0.99.4 API Reference - Generated using Doxygen 1.7.1