Inherits from CCAction : NSObject
Conforms to NSCopying
Declared in CCAction.h

Overview

Creates an action which follows a node.

Note: In stead of using CCCamera to follow a node, use this action.

Example: [layer runAction: [CCFollow actionWithTarget:hero]];

Tasks

Accessing the Follow Action Attributes

Creating a CCActionFollow Object

Initializing a CCActionFollow Object

Properties

boundarySet

Turns boundary behaviour on / off. If set to YES, movement will be clamped to boundaries.

@property (nonatomic, readwrite) BOOL boundarySet

Declared In

CCAction.h

Class Methods

actionWithTarget:

Creates a follow action with no boundaries.

+ (id)actionWithTarget:(CCNode *)followedNode

Parameters

followedNode

Node to follow.

Return Value

The follow action object.

Declared In

CCAction.h

actionWithTarget:worldBoundary:

Creates a follow action with boundaries.

+ (id)actionWithTarget:(CCNode *)followedNode worldBoundary:(CGRect)rect

Parameters

followedNode

Node to follow.

rect

Boundary rect.

Return Value

The follow action object.

Declared In

CCAction.h

Instance Methods

initWithTarget:

Initalizes a follow action with no boundaries.

- (id)initWithTarget:(CCNode *)followedNode

Parameters

followedNode

Node to follow.

Return Value

An initialized follow action object.

Declared In

CCAction.h

initWithTarget:worldBoundary:

Initalizes a follow action with boundaries.

- (id)initWithTarget:(CCNode *)followedNode worldBoundary:(CGRect)rect

Parameters

followedNode

Node to follow.

rect

Boundary rect.

Return Value

The initalized follow action object.

Declared In

CCAction.h