Inherits from CCNode : CCResponder : NSObject
Declared in CCDrawNode.h

Overview

CCDrawNode Node that draws dots, segments and polygons. The geometry will be saved, so primitives does not need to be redrawn for each frame Faster than the “drawing primitives” since they it draws everything in one single batch.

Instance Methods

clear

Clear the geometry in the node’s buffer.

- (void)clear

Declared In

CCDrawNode.h

drawDot:radius:color:

Draw a dot at a position, with a given radius and color.

- (void)drawDot:(CGPoint)pos radius:(CGFloat)radius color:(CCColor *)color

Parameters

pos

Dot position.

radius

Dot radius.

color

Dot color.

Declared In

CCDrawNode.h

drawPolyWithVerts:count:fillColor:borderWidth:borderColor:

Draw a polygon with a fill color and line color.

- (void)drawPolyWithVerts:(const CGPoint *)verts count:(NSUInteger)count fillColor:(CCColor *)fill borderWidth:(CGFloat)width borderColor:(CCColor *)line

Parameters

verts

Array of CGPoints, containing the vertices.

count

Number of vertices.

fill

Polygon fill color.

width

Polygon outline width.

line

Polygon outline color.

Declared In

CCDrawNode.h

drawSegmentFrom:to:radius:color:

Draw a segment with a radius and color.

- (void)drawSegmentFrom:(CGPoint)a to:(CGPoint)b radius:(CGFloat)radius color:(CCColor *)color

Parameters

a

Segment starting point.

b

Segment end point.

radius

Segment radius.

color

Segment color.

Declared In

CCDrawNode.h