cocos2d for iPhone 1.0.0
2D engine for iOS and OS X
Functions
/Users/rquesada/progs/cocos2d-iphone/cocos2d/CCDrawingPrimitives.h File Reference
#import <Availability.h>
#import <Foundation/Foundation.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 (const CGPoint *points, NSUInteger numberOfPoints)
void ccDrawLine (CGPoint origin, CGPoint destination)
void ccDrawPoly (const CGPoint *vertices, NSUInteger numOfVertices, BOOL closePolygon)
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)

Detailed Description

Drawing OpenGL ES primitives.

You can change the color, width and other property by calling the glColor4ub(), glLineWidth(), 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,
NSUInteger  segments,
BOOL  drawLineToCenter 
)

draws a circle given the center, radius and number of segments measured in points

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

draws a cubic bezier path measured in points.

Since:
v0.8
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.

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

draws a poligon given a pointer to CGPoint coordiantes 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.

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

cocos2d for iPhone API Reference - Generated using Doxygen 1.7.4