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

Overview

An interval action is an action that takes place within a certain period of time. It has an start time, and a finish time. The finish time is the parameter duration plus the start time.

These CCIntervalAction actions have some interesting properties, like: – They can run normally (default) – They can run reversed with the reverse method – They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.

For example, you can simulate a Ping Pong effect running the action normally and then running it again in Reverse mode.

Example:

CCAction * pingPongAction = [CCSequence actions: action, [action reverse], nil];

Tasks

Properties

elapsed

how many seconds had elapsed since the actions started to run.

@property (nonatomic, readonly) ccTime elapsed

Declared In

CCIntervalAction.h

Class Methods

actionWithDuration:

creates the action

+ (id)actionWithDuration:(ccTime)d

Declared In

CCIntervalAction.h

Instance Methods

initWithDuration:

initializes the action

- (id)initWithDuration:(ccTime)d

Declared In

CCIntervalAction.h

isDone

returns YES if the action has finished

- (BOOL)isDone

Declared In

CCIntervalAction.h

reverse

returns a reversed action

- (CCIntervalAction *)reverse

Declared In

CCIntervalAction.h