Hi all, I would like to share a class which I wrote. Its called AdvanceSprite and its basically an easier way to control sprite animations. You can do things like set frame rate for every object, move from any frame to any frame. Loops n number of times etc. I feel its easier than using the CCAction for Sprite Frame animation.
Animation done using Sprite frames by loading Sprite Sheet.
It extends from CCSprite. Its more advance and easy to use then CCAction.
- Pause animation.
- Resume animation.
- Stop animation.
- Callback after complete the animation.
Additional control are
- Changing frame rate during running of animation.
- while running animation we can move to any frames from current running frame.
- Looping Animation.
- Reverse Animation with Looping.
- Delete by itself after complete animation.
AdvanceSprite m_advanceSprite = new AdvanceSprite();
//Add Sprite pList or CCSpriteFrame Array.
m_advanceSprite~~>startAnimation(int startInd, int endInd, int number_Loop, SEL_CallFunc pfnSelectorDelegate, SelectorProtocol *pTarget,int NumberOfFramesPerSecond, bool NeedToRunReverseAnimation, bool NeedToDeleteItself);
//To move to any frame from the current frame
Advance_Sprite_Animation.zip (3.4 KB)