The 2D frame animation editor for cocos2dx.
- Works without extra library.
- WYSIWYG(what you see is what you get) editing
- Suitable for cocos2dx 3.0+ or any version which has
AnimationCache
class. - Quick and safe.
- Download AnimatePacker from release
- Use TexturePacker to pack all your animation frames into one
*.plist
and*.png
- Drag your plist file into AnimatePacker4
- Edit your animations as you wish, multiple plists and animations are supported
- Click
File
-Svae
to save your animation file (as a*.xml
file, it's actually a plist format xml file) - Make sure all your
*.plist
and*.png
and*.xml
files are all in your game'sres/
folder - Import in your game as follow
...
// load animations into cache
auto ac = AnimationCache::getInstance();
ac->addAnimationsWithFile("Your-awsome-animation-file.xml");
...
// use
auto ac = AnimationCache::getInstance();
auto s = Sprite::create(); // empty sprite
ac->getAnimation("One-of-the-animation-name")->setLoops(-1); // Optional, set loop
auto animate = Animate::create(ac->getAnimation("One-of-the-animation-name"));
s->runAction(animate)
// don't forget to add sprite into your scene.
...
-- load
local ac = cc.AnimationCache:getInstance()
ac:addAnimations("pl00.xml")
...
-- use
local player = cc.Sprite:create()
local animate = cc.Animate:create(ac:getAnimation("player00LeftIdle"))
player:runAction(animate)
player:setPosition(display.center)
player:addTo(self)
- 从release中下载AnimatePacker4
- 使用 TexturePacker 来打包你的帧动画的所有帧到一个
.plist
和一个.png
文件 - 拖拉你的
.plist
文件到AnimatePacker4中 - 编辑你的动画,延迟,名字。 同时支持多个plist混合使用。
- 点击
File
-Save
来保存你的动画为一个.xml
文件(事实上是一个Apple-plist格式的xml) - 保证全部你用到过的
.plist
文件和.png
文件都在你的游戏的res/
目录或者类似目录下 - 在代码中导入,使用。 示例代码如上面所示。
- JS is also supported but I don't write js.
- HUGE shout out to origin author