Inherits from CCActionInterval
Conforms to NSCopying
Declared in CC3Actions.h

Overview

CC3ActionAnimate animates a single track of animation on a CC3Node and its descendants.

To animate a node, CC3ActionAnimate invokes the establishAnimationFrameAt:onTrack: method of the target CC3Node. The heavy lifting is performed by the CC3NodeAnimation instance held in the animation property of the node.

The establishAnimationFrameAt:onTrack: method of the CC3Node also takes care of propagating the animation to its descendant nodes. A complete assembly of nodes can therefore be animated in concert for one track of information using a single CC3ActionAnimate instance.

It is possible to animate only a fraction of the full animation. This can be done using either the actionWithDuration:onTrack:limitFrom:to: or asActionLimitedFrom:to: methods.

Doing so will result is an animation action that will perform only part of the animation. This is very useful for an node that contains several different motions in one animation. Using a range-limited CC3ActionAnimate, you can animate one of those distinct motions without having to run the full animation. To do this, set the startOfRange and endOfRange values to the fractional positions (between zero and one) of the start and end frames of the sub-animation.

For example, if a character animation contains a punch animation that starts and stops at relative positions 0.67 and 0.78 respectively within the full animation, setting those two values here will result in an animation containing only the punch.

Properties

isReversed

Indicates whether this action is running in reverse. Setting this to YES will cause the animation to run in reverse.

@property (nonatomic, assign) BOOL isReversed

Discussion

Generally, this is set when creating a reverse action using the reverse method of a normal CCActionInterval instance to create its compliment. The application will generally not set this property directly.

Declared In

CC3Actions.h

trackID

The animation track on which the animation runs.

@property (nonatomic, assign, readonly) GLuint trackID

Declared In

CC3Actions.h

Class Methods

actionWithDuration:

Allocates and initializes an autoreleased instance to animate animation track zero on the target node, over the specified time duration.

+ (id)actionWithDuration:(CCTime)t

Declared In

CC3Actions.h

actionWithDuration:limitFrom:to:

Allocates and initializes an autoreleased instance to animate animation track zero on the target node, over the specified time duration, then wraps that instance in an autoreleased CC3ActionRangeLimit instance that maps the normal zero-to-one update range to the specified range, and returns the CC3ActionRangeLimit instance.

+ (id)actionWithDuration:(CCTime)t limitFrom:(GLfloat)startOfRange to:(GLfloat)endOfRange

Discussion

The effective result is an animation action that will perform only part of the animation. This is very useful for a node that contains several different motions in one animation. Using a range-limited CC3ActionAnimate, you can animate one of those distinct motions without having to run the full animation. To do this, set the startOfRange and endOfRange values to the fractional positions (between zero and one) of the start and end frames of the sub-animation.

For example, if a character animation contains a punch animation that starts and stops at relative positions 0.67 and 0.78 respectively within the full animation, setting those two values here will result in an animation containing only the punch.

Declared In

CC3Actions.h

actionWithDuration:onTrack:

Allocates and initializes an autoreleased instance to animate the specified animation track on the target node, over the specified time duration.

+ (id)actionWithDuration:(CCTime)t onTrack:(GLuint)trackID

Declared In

CC3Actions.h

actionWithDuration:onTrack:limitFrom:to:

Allocates and initializes an autoreleased instance to animate the specified animation track on the target node, over the specified time duration, then wraps that instance in an autoreleased CC3ActionRangeLimit instance that maps the normal zero-to-one update range to the specified range, and returns the CC3ActionRangeLimit instance.

+ (id)actionWithDuration:(CCTime)t onTrack:(GLuint)trackID limitFrom:(GLfloat)startOfRange to:(GLfloat)endOfRange

Discussion

The effective result is an animation action that will perform only part of the animation. This is very useful for a node that contains several different motions in one animation. Using a range-limited CC3ActionAnimate, you can animate one of those distinct motions without having to run the full animation. To do this, set the startOfRange and endOfRange values to the fractional positions (between zero and one) of the start and end frames of the sub-animation.

For example, if a character animation contains a punch animation that starts and stops at relative positions 0.67 and 0.78 respectively within the full animation, setting those two values here will result in an animation containing only the punch.

Declared In

CC3Actions.h

Instance Methods

asActionLimitedFrom:to:

Wraps this instance in an autoreleased CC3ActionRangeLimit instance that maps the normal zero-to-one update range to the specified range, and returns the CC3ActionRangeLimit instance

- (CCActionInterval *)asActionLimitedFrom:(GLfloat)startOfRange to:(GLfloat)endOfRange

Discussion

The effective result is an animation action that will perform only part of the animation. This is very useful for an node that contains several different motions in one animation. Using a range-limited CC3ActionAnimate, you can animate one of those distinct motions without having to run the full animation. To do this, set the startOfRange and endOfRange values of the fractional positions (between zero and one) of the start and end frames of the sub-animation.

For example, if a character animation contains a punch animation that starts and stops at relative positions 0.67 and 0.78 respectively within the full animation, setting those two values here will result in an animation containing only the punch.

Declared In

CC3Actions.h

initWithDuration:

Initializes this instance to animate animation track zero on the target node, over the specified time duration.

- (id)initWithDuration:(CCTime)t

Declared In

CC3Actions.h

initWithDuration:onTrack:

Initializes this instance to animate the specified animation track on the target node, over the specified time duration.

- (id)initWithDuration:(CCTime)t onTrack:(GLuint)trackID

Declared In

CC3Actions.h