Public Member Functions | Static Public Member Functions | Properties

CCAnimation Class Reference

#import "CCAnimation.h"

List of all members.

Public Member Functions

(void) - addFrame:
(void) - addFrameWithFilename:
(void) - addFrameWithTexture:rect:
(id) - initWithFrames:
(id) - initWithFrames:delay:
(id) - initWithName:
(id) - initWithName:delay:
(id) - initWithName:delay:frames:
(id) - initWithName:frames:

Static Public Member Functions

(id) + animation
(id) + animationWithFrames:
(id) + animationWithName:
(id) + animationWithName:delay:
(id) + animationWithName:delay:frames:
(id) + animationWithName:frames:

Properties

float delay
NSMutableArray * frames
NSString * name

Detailed Description

A CCAnimation object is used to perform animations on the CCSprite objects.

The CCAnimation object contains CCSpriteFrame objects, and a possible delay between the frames. You can animate a CCAnimation object by using the CCAnimate action. Example:

[sprite runAction:[CCAnimate actionWithAnimation:animation]];


Member Function Documentation

- (void) addFrame: (CCSpriteFrame *)  frame  

Adds a frame to a CCAnimation.

- (void) addFrameWithFilename: (NSString *)  filename  

Adds a frame with an image filename. Internally it will create a CCSpriteFrame and it will add it. Added to facilitate the migration from v0.8 to v0.9.

- (void) addFrameWithTexture: (CCTexture2D *)  texture
rect: (CGRect)  rect 

Adds a frame with a texture and a rect. Internally it will create a CCSpriteFrame and it will add it. Added to facilitate the migration from v0.8 to v0.9.

+ (id) animation  

Creates an animation

Since:
v0.99.5
+ (id) animationWithFrames: (NSArray *)  frames  

Creates an animation with frames.

Since:
v0.99.5
+ (id) animationWithName: (NSString *)  DEPRECATED_ATTRIBUTE  

Creates a CCAnimation with a name

Since:
v0.99.3
Deprecated:
Will be removed in 1.0.1. Use "animation" instead.
+ (id) animationWithName: (NSString *)  name
delay: (float)  DEPRECATED_ATTRIBUTE 

Creates a CCAnimation with a name and delay between frames.

+ (id) animationWithName: (NSString *)  name
delay: (float)  delay
frames: (NSArray *)  DEPRECATED_ATTRIBUTE 

Creates a CCAnimation with a name, delay and an array of CCSpriteFrames.

+ (id) animationWithName: (NSString *)  name
frames: (NSArray *)  DEPRECATED_ATTRIBUTE 

Creates a CCAnimation with a name and frames

Since:
v0.99.3
Deprecated:
Will be removed in 1.0.1. Use "animationWithFrames" instead.
- (id) initWithFrames: (NSArray *)  frames  

Initializes a CCAnimation with frames.

Since:
v0.99.5
- (id) initWithFrames: (NSArray *)  frames
delay: (float)  delay 

Initializes a CCAnimation with frames and a delay between frames

Since:
v0.99.5
- (id) initWithName: (NSString *)  DEPRECATED_ATTRIBUTE  

Initializes a CCAnimation with a name

Since:
v0.99.3
Deprecated:
Will be removed in 1.0.1. Use "init" instead.
- (id) initWithName: (NSString *)  name
delay: (float)  DEPRECATED_ATTRIBUTE 

Initializes a CCAnimation with a name and delay between frames.

Deprecated:
Will be removed in 1.0.1. Use "initWithFrames:nil delay:delay" instead.
- (id) initWithName: (NSString *)  name
delay: (float)  delay
frames: (NSArray *)  DEPRECATED_ATTRIBUTE 

Initializes a CCAnimation with a name, delay and an array of CCSpriteFrames.

Deprecated:
Will be removed in 1.0.1. Use "initWithFrames:frames delay:delay" instead.
- (id) initWithName: (NSString *)  name
frames: (NSArray *)  DEPRECATED_ATTRIBUTE 

Initializes a CCAnimation with a name and frames

Since:
v0.99.3
Deprecated:
Will be removed in 1.0.1. Use "initWithFrames" instead.

Property Documentation

- (float) delay [read, write, assign]

delay between frames in seconds.

- (NSMutableArray*) frames [read, write, retain]

array of frames

- (NSString*) name [read, write, retain]

name of the animation


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