Public Member Functions | Static Public Member Functions | Properties

CC3Animate Class Reference

A CCActionInterval that animates a CC3Node. More...

#import <CC3ActionInterval.h>

List of all members.

Public Member Functions

(CCActionInterval *) - asActionLimitedFrom:to:

Static Public Member Functions

(id) + actionWithDuration:limitFrom:to:

Properties

BOOL isReversed

Detailed Description

A CCActionInterval that animates a CC3Node.

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

The establishAnimationFrameAt: method of the CC3Node also takes care of propagating the animation to its child nodes. A complete assembly of nodes can therefore be animated in concert using a single CC3Animate instance.

It is possible to animate only a fraction of the full animation. This can be done using either the actionWithDuration: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 CC3Animate, 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.


Member Function Documentation

+ (id) actionWithDuration: (ccTime)  d
limitFrom: (GLfloat)  startOfRange
to: (GLfloat)  endOfRange 

Allocates and initializes an autoreleased instance with the specified 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.

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 CC3Animate, 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.

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

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.

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 CC3Animate, 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.


Property Documentation

- (BOOL) isReversed [read, write, assign]

Indicates whether this action is running in reverse.

Setting this to YES will cause the animation to run in reverse.

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.


The documentation for this class was generated from the following file: