A Animation object is used to perform animations on the Sprite objects. More...
Public Member Functions | |
| void | addSpriteFrame (SpriteFrame *frame) |
| Adds a SpriteFrame to a Animation. More... | |
| var | addSpriteFrame ( var frame) |
| Adds a SpriteFrame to a Animation. More... | |
| local | addSpriteFrame ( local 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... | |
| var | addSpriteFrameWithTexture ( var pobTexture, var rect) |
| Adds a frame with a texture and a rect. More... | |
| local | addSpriteFrameWithTexture ( local pobTexture, local rect) |
| Adds a frame with a texture and a rect. More... | |
| float | getTotalDelayUnits () const |
| Gets the total Delay units of the Animation. More... | |
| void | setDelayPerUnit (float delayPerUnit) |
| Sets the delay in seconds of the "delay unit". More... | |
| var | setDelayPerUnit ( var delayPerUnit) |
| Sets the delay in seconds of the "delay unit". More... | |
| local | setDelayPerUnit ( local delayPerUnit) |
| Sets the delay in seconds of the "delay unit". More... | |
| float | getDelayPerUnit () const |
| 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... | |
| 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. | |
Public Member Functions inherited from Ref | |
| void | retain () |
| Retains the ownership. More... | |
| local | 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... | |
| local | getReferenceCount () |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
| Destructor. | |
Public Member Functions inherited from Clonable | |
| Ref * | copy () const |
| Returns a copy of the Ref. | |
Static Public Member Functions | |
| static Animation * | create (void) |
| Creates an animation. | |
| var | create () |
| Creates an animation. | |
| local | create () |
| Creates an animation. | |
Protected Member Functions | |
| bool | init () |
| Initializes a Animation. | |
| var | init () |
| Initializes a Animation. | |
| local | init () |
| Initializes a Animation. | |
| 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 0f, var 1) |
| Initializes a Animation with frames and a delay between frames. | |
| local | initWithSpriteFrames ( local arrayOfSpriteFrameNames, local 0f, local 1) |
| Initializes a Animation with frames and a delay between frames. | |
| 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. | |
Additional Inherited Members | |
Public Attributes inherited from Ref | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID | |
| local | _ID |
| object id, ScriptSupport need public _ID | |
| int | _luaID |
| Lua reference id. | |
| local | _luaID |
| Lua reference id. | |
| void * | _scriptObject |
| scriptObject, support for swift | |
| local | _scriptObject |
| scriptObject, support for swift | |
| bool | _rooted |
| When true, it means that the object was already rooted. | |
| local | _rooted |
| When true, it means that the object was already rooted. | |
| bool | _scriptOwned |
| The life of the object is scrolled by the scripting engine. More... | |
| local | _scriptOwned |
| The life of the object is scrolled by the scripting engine. 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:
| void addSpriteFrame | ( | SpriteFrame * | frame | ) |
Adds a SpriteFrame to a Animation.
The frame will be added with one "delay unit".
| var addSpriteFrame | ( | var | frame | ) |
Adds a SpriteFrame to a Animation.
The frame will be added with one "delay unit".
| local addSpriteFrame | ( | local | frame | ) |
Adds a SpriteFrame to a Animation.
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. 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. 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. 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. A frame with a texture. 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. A frame with a texture. 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. A frame with a texture. The Texture of rect.
|
inline |
|
inline |
|
inline |
|
inline |
Sets the delay in seconds of the "delay unit".
The delay in seconds of the "delay unit".
|
inline |
Sets the delay in seconds of the "delay unit".
The delay in seconds of the "delay unit".
|
inline |
Sets the delay in seconds of the "delay unit".
The delay in seconds of the "delay unit".
|
inline |
Gets the delay in seconds of the "delay unit".
The delay in seconds of the "delay unit".
|
inline |
Gets the delay in seconds of the "delay unit".
The delay in seconds of the "delay unit".
|
inline |
Gets the delay in seconds of the "delay unit".
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.
Result of totalDelayUnits * delayPerUnit.
| var getDuration | ( | ) |
Gets the duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
Result of totalDelayUnits * delayPerUnit.
| local getDuration | ( | ) |
Gets the duration in seconds of the whole animation.
It is the result of totalDelayUnits * delayPerUnit.
Result of totalDelayUnits * delayPerUnit.
|
inline |
Gets the array of AnimationFrames.
The array of AnimationFrames.
|
inline |
Gets the array of AnimationFrames.
The array of AnimationFrames.
|
inline |
Gets the array of AnimationFrames.
The array of AnimationFrames.
|
inline |
Sets the array of AnimationFrames.
The array of AnimationFrames.
|
inline |
Sets the array of AnimationFrames.
The array of AnimationFrames.
|
inline |
Sets the array of AnimationFrames.
The array of AnimationFrames.
|
inline |
Checks whether to restore the original frame when animation finishes.
Restore the original frame when animation finishes.
|
inline |
Checks whether to restore the original frame when animation finishes.
Restore the original frame when animation finishes.
|
inline |
Checks whether to restore the original frame when animation finishes.
Restore the original frame when animation finishes.
|
inline |
Sets whether to restore the original frame when animation finishes.
Whether to restore the original frame when animation finishes.
|
inline |
Sets whether to restore the original frame when animation finishes.
Whether to restore the original frame when animation finishes.
|
inline |
Sets whether to restore the original frame when animation finishes.
Whether to restore the original frame when animation finishes.
|
inline |
Gets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
The times the animation is going to loop.
|
inline |
Gets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
The times the animation is going to loop.
|
inline |
Gets the times the animation is going to loop.
0 means animation is not animated. 1, animation is executed one time, ...
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, ...
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, ...
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, ...
The times the animation is going to loop.