I create a tool named Super Animation Converter, which is a simple SWF (a file format supported by Adobe Flash Player software) converter. It can parse and extract transformation data from SWF file. With these transformation data and the right images, you can reproduce the animation in any game engine just as Adobe Flash Player can do.
The native animation solution in Cocos2D game engine is “frame by frame” animation, which means if there are 20 frames in your animation, you need 20 pieces of image(texture), and draw these images one by one on the screen to create animation effect. There are two flaws in this solution:
1 High resource consuming, one frame one image;
2 Hard to make smooth animation, since no interpolation between frames, which means it “jumps” directly from the current frame to the next frame.
So I try to provide a better animation solution which is based on Super Animation Converter for Cocos2D game engine. The idea is very simple:
1 Use Flash as your animation editor, create any animation you want in it, then export these animation as SWF file.
2 Parse the SWF file with Super Animation Converter, get the transformation data and images(NOT the whole frame) from the SWF file.
3 Reproduce the animation in Cocos2D game engine with the transformation data and images.
This project costs me lots of time.
But since we are so close to the end of the world, I decide to share it with all of you guys.
Please read “super_anim_help_english_version_1.pdf” first, then enjoy it!
I’ve put the tool & source code in github:
1 Support sprite sheet, which means you can use TexturePacker to pack some small images into one big images
2 Support resize animation, you can resize one animation to different size to support multiple resolution
3 Add set flip x&y function
4 Fix some crash bugs, some depth bugs, alpha blend bugs, more stable now
5 Support rename animation sprite name, please refer to the help doc
6 Support replace animation sprite at runtime, please refer to the sample code
7 Support time event, please refer to the sample code
8 A simple version of converter is added for Windows OS