A Animation object is used to perform animations on the Sprite objects. More...
#include <CCAnimation.h>
Public Member Functions | |
| void | addSpriteFrame (SpriteFrame *frame) |
| Adds a SpriteFrame to a Animation. More... | |
| void | addSpriteFrameWithFile (const std::string &filename) |
| Adds a frame with an image filename. More... | |
| var | addSpriteFrameWithFile ( var filename) |
| Adds a frame with an image filename. More... | |
| local | addSpriteFrameWithFile ( local filename) |
| Adds a frame with an image filename. More... | |
| void | addSpriteFrameWithFileName (const std::string &filename) |
| local | addSpriteFrameWithFileName ( local filename) |
| void | addSpriteFrameWithTexture (Texture2D *pobTexture, const Rect &rect) |
| Adds a frame with a texture and a rect. More... | |
| float | getTotalDelayUnits () const |
| Gets the total Delay units of the Animation. More... | |
| var | getTotalDelayUnits () |
| Gets the total Delay units of the Animation. More... | |
| local | getTotalDelayUnits () |
| Gets the total Delay units of the Animation. More... | |
| void | setDelayPerUnit (float delayPerUnit) |
| Sets the delay in seconds of the "delay unit". More... | |
| float | getDelayPerUnit () const |
| Gets the delay in seconds of the "delay unit". More... | |
| var | getDelayPerUnit () |
| Gets the delay in seconds of the "delay unit". More... | |
| local | getDelayPerUnit () |
| Gets the delay in seconds of the "delay unit". More... | |
| float | getDuration () const |
| Gets the duration in seconds of the whole animation. More... | |
| const Vector< AnimationFrame * > & | getFrames () const |
| Gets the array of AnimationFrames. More... | |
| local | getFrames () |
| Gets the array of AnimationFrames. More... | |
| void | setFrames (const Vector< AnimationFrame * > &frames) |
| Sets the array of AnimationFrames. More... | |
| var | setFrames ( var frames) |
| Sets the array of AnimationFrames. More... | |
| local | setFrames ( local frames) |
| Sets the array of AnimationFrames. More... | |
| bool | getRestoreOriginalFrame () const |
| Checks whether to restore the original frame when animation finishes. More... | |
| void | setRestoreOriginalFrame (bool restoreOriginalFrame) |
| Sets whether to restore the original frame when animation finishes. More... | |
| local | setRestoreOriginalFrame ( local restoreOriginalFrame) |
| Sets whether to restore the original frame when animation finishes. More... | |
| unsigned int | getLoops () const |
| Gets the times the animation is going to loop. More... | |
| void | setLoops (unsigned int loops) |
| Sets the times the animation is going to loop. More... | |
| var | setLoops ( var loops) |
| Sets the times the animation is going to loop. More... | |
| local | setLoops ( local loops) |
| Sets the times the animation is going to loop. More... | |
| virtual Animation * | clone () const override |
| Returns a copy of the Ref. More... | |
| var | clone () |
| Returns a copy of the Ref. More... | |
| local | clone () |
| Returns a copy of the Ref. More... | |
| virtual | ~Animation (void) |
| var | ~Animation () |
| local | ~Animation () |
| bool | init () |
| Initializes a Animation. More... | |
| var | init () |
| Initializes a Animation. More... | |
| local | init () |
| Initializes a Animation. More... | |
| bool | initWithSpriteFrames (const Vector< SpriteFrame * > &arrayOfSpriteFrameNames, float delay=0.0f, unsigned int loops=1) |
| Initializes a Animation with frames and a delay between frames. More... | |
| var | initWithSpriteFrames ( var arrayOfSpriteFrameNames, var 0f, var 1) |
| Initializes a Animation with frames and a delay between frames. More... | |
| local | initWithSpriteFrames ( local arrayOfSpriteFrameNames, local 0f, local 1) |
| Initializes a Animation with frames and a delay between frames. More... | |
| bool | initWithAnimationFrames (const Vector< AnimationFrame * > &arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops) |
| Initializes a Animation with AnimationFrame. More... | |
| local | initWithAnimationFrames ( local arrayOfAnimationFrameNames, local delayPerUnit, local loops) |
| Initializes a Animation with AnimationFrame. More... | |
Public Member Functions inherited from Ref | |
| void | retain () |
| Retains the ownership. More... | |
| void | release () |
| Releases the ownership immediately. More... | |
| Ref * | autorelease () |
| Releases the ownership sometime soon automatically. More... | |
| unsigned int | getReferenceCount () const |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
| Destructor. More... | |
Public Member Functions inherited from Clonable | |
| virtual | ~Clonable () |
| Ref * | copy () const |
| Returns a copy of the Ref. More... | |
Static Public Member Functions | |
| static Animation * | create (void) |
| Creates an animation. More... | |
| var | create () |
| Creates an animation. More... | |
| local | create () |
| Creates an animation. More... | |
| static Animation * | createWithSpriteFrames (const Vector< SpriteFrame * > &arrayOfSpriteFrameNames, float delay=0.0f, unsigned int loops=1) |
| static Animation * | create (const Vector< AnimationFrame * > &arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops=1) |
| local | create ( local arrayOfAnimationFrameNames, local delayPerUnit, local 1) |
Public Attributes | |
| CC_CONSTRUCTOR_ACCESS | __pad0__: Animation() |
Protected Attributes | |
| float | _totalDelayUnits |
| total Delay units of the Animation. More... | |
| float | _delayPerUnit |
| Delay in seconds of the "delay unit". More... | |
| float | _duration |
| duration in seconds of the whole animation. More... | |
| var | _duration |
| duration in seconds of the whole animation. More... | |
| local | _duration |
| duration in seconds of the whole animation. More... | |
| Vector< AnimationFrame * > | _frames |
| array of AnimationFrames. More... | |
| var | _frames |
| array of AnimationFrames. More... | |
| local | _frames |
| array of AnimationFrames. More... | |
| bool | _restoreOriginalFrame |
| whether or not it shall restore the original frame when the animation finishes. More... | |
| var | _restoreOriginalFrame |
| whether or not it shall restore the original frame when the animation finishes. More... | |
| local | _restoreOriginalFrame |
| whether or not it shall restore the original frame when the animation finishes. More... | |
| unsigned int | _loops |
| how many times the animation is going to loop. More... | |
Protected Attributes inherited from Ref | |
| unsigned int | _referenceCount |
| count of references More... | |
| local | _referenceCount |
| count of references More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Ref | |
| Ref () | |
| Constructor. More... | |
| Ref () | |
| Constructor. More... | |
A Animation object is used to perform animations on the Sprite objects.
The Animation object contains AnimationFrame objects, and a possible delay between the frames. You can animate a Animation object by using the Animate action. Example:
|
virtual |
|
virtual |
|
virtual |
| void addSpriteFrame | ( | SpriteFrame * | frame | ) |
Adds a SpriteFrame to a Animation.
| frame | The frame will be added with one "delay unit". |
| var addSpriteFrame | ( | var | frame | ) |
Adds a SpriteFrame to a Animation.
| frame | The frame will be added with one "delay unit". |
| local addSpriteFrame | ( | local | frame | ) |
Adds a SpriteFrame to a Animation.
| frame | The frame will be added with one "delay unit". |
| void addSpriteFrameWithFile | ( | const std::string & | filename | ) |
Adds a frame with an image filename.
Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9.
| filename | The path of SpriteFrame. |
| var addSpriteFrameWithFile | ( | var | filename | ) |
Adds a frame with an image filename.
Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9.
| filename | The path of SpriteFrame. |
| local addSpriteFrameWithFile | ( | local | filename | ) |
Adds a frame with an image filename.
Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9.
| filename | The path of SpriteFrame. |
|
inline |
|
inline |
Adds a frame with a texture and a rect.
Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9.
| pobTexture | A frame with a texture. |
| rect | The Texture of rect. |
| var addSpriteFrameWithTexture | ( | var | pobTexture, |
| var | rect | ||
| ) |
Adds a frame with a texture and a rect.
Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9.
| pobTexture | A frame with a texture. |
| rect | The Texture of rect. |
| local addSpriteFrameWithTexture | ( | local | pobTexture, |
| local | rect | ||
| ) |
Adds a frame with a texture and a rect.
Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9.
| pobTexture | A frame with a texture. |
| rect | The Texture of rect. |
|
static |
Creates an animation.
|
static |
Creates an animation.
|
static |
Creates an animation.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inline |
Gets the delay in seconds of the "delay unit".
|
inline |
Gets the delay in seconds of the "delay unit".
|
inline |
Gets the delay in seconds of the "delay unit".
| float getDuration | ( | ) | const |
Gets the duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
| var getDuration | ( | ) |
Gets the duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
| local getDuration | ( | ) |
Gets the duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
|
inline |
Gets the array of AnimationFrames.
|
inline |
Gets the array of AnimationFrames.
|
inline |
Gets the array of AnimationFrames.
|
inline |
Gets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
|
inline |
Gets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
|
inline |
Gets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
|
inline |
Checks whether to restore the original frame when animation finishes.
|
inline |
Checks whether to restore the original frame when animation finishes.
|
inline |
Checks whether to restore the original frame when animation finishes.
|
inline |
|
inline |
|
inline |
| bool init | ( | ) |
Initializes a Animation.
| var init | ( | ) |
Initializes a Animation.
| local init | ( | ) |
Initializes a Animation.
| bool initWithAnimationFrames | ( | const Vector< AnimationFrame * > & | arrayOfAnimationFrameNames, |
| float | delayPerUnit, | ||
| unsigned int | loops | ||
| ) |
Initializes a Animation with AnimationFrame.
| var initWithAnimationFrames | ( | var | arrayOfAnimationFrameNames, |
| var | delayPerUnit, | ||
| var | loops | ||
| ) |
Initializes a Animation with AnimationFrame.
| local initWithAnimationFrames | ( | local | arrayOfAnimationFrameNames, |
| local | delayPerUnit, | ||
| local | loops | ||
| ) |
Initializes a Animation with AnimationFrame.
| bool initWithSpriteFrames | ( | const Vector< SpriteFrame * > & | arrayOfSpriteFrameNames, |
| float | delay = 0.0f, |
||
| unsigned int | loops = 1 |
||
| ) |
Initializes a Animation with frames and a delay between frames.
| var initWithSpriteFrames | ( | var | arrayOfSpriteFrameNames, |
| var | delay = 0.0f, |
||
| var | loops = 1 |
||
| ) |
Initializes a Animation with frames and a delay between frames.
| local initWithSpriteFrames | ( | local | arrayOfSpriteFrameNames, |
| local | delay = 0.0f, |
||
| local | loops = 1 |
||
| ) |
Initializes a Animation with frames and a delay between frames.
|
inline |
Sets the delay in seconds of the "delay unit".
| setDelayPerUnit | The delay in seconds of the "delay unit". |
|
inline |
Sets the delay in seconds of the "delay unit".
| setDelayPerUnit | The delay in seconds of the "delay unit". |
|
inline |
Sets the delay in seconds of the "delay unit".
| setDelayPerUnit | The delay in seconds of the "delay unit". |
|
inline |
Sets the array of AnimationFrames.
| frames | The array of AnimationFrames. |
|
inline |
Sets the array of AnimationFrames.
| frames | The array of AnimationFrames. |
|
inline |
Sets the array of AnimationFrames.
| frames | The array of AnimationFrames. |
|
inline |
Sets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
| loops | The times the animation is going to loop. |
|
inline |
Sets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
| loops | The times the animation is going to loop. |
|
inline |
Sets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
| loops | The times the animation is going to loop. |
|
inline |
Sets whether to restore the original frame when animation finishes.
| restoreOriginalFrame | Whether to restore the original frame when animation finishes. |
|
inline |
Sets whether to restore the original frame when animation finishes.
| restoreOriginalFrame | Whether to restore the original frame when animation finishes. |
|
inline |
Sets whether to restore the original frame when animation finishes.
| restoreOriginalFrame | Whether to restore the original frame when animation finishes. |
| CC_CONSTRUCTOR_ACCESS __pad0__ |
| var __pad0__ |
| local __pad0__ |
|
protected |
Delay in seconds of the "delay unit".
|
protected |
Delay in seconds of the "delay unit".
|
protected |
Delay in seconds of the "delay unit".
|
protected |
duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
|
protected |
duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
|
protected |
duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
|
protected |
array of AnimationFrames.
|
protected |
array of AnimationFrames.
|
protected |
array of AnimationFrames.
|
protected |
how many times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
|
protected |
how many times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
|
protected |
how many times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
|
protected |
whether or not it shall restore the original frame when the animation finishes.
|
protected |
whether or not it shall restore the original frame when the animation finishes.
|
protected |
whether or not it shall restore the original frame when the animation finishes.
|
protected |
total Delay units of the Animation.
|
protected |
total Delay units of the Animation.
|
protected |
total Delay units of the Animation.