GithubHelp home page GithubHelp logo

hellokenlee / animatepacker4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gdgoldlion/animatepacker

3.0 1.0 1.0 95 KB

Frame Animation Editor for cocos2dx (cocos2dx 帧动画编辑器)

QMake 2.15% C++ 97.85%

animatepacker4's Introduction

AnimatePacker4

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.

Usage

  1. Download AnimatePacker from release
  2. Use TexturePacker to pack all your animation frames into one *.plist and *.png
  3. Drag your plist file into AnimatePacker4
  4. Edit your animations as you wish, multiple plists and animations are supported
  5. Click File-Svae to save your animation file (as a *.xml file, it's actually a plist format xml file)
  6. Make sure all your *.plist and *.png and *.xml files are all in your game's res/ folder
  7. Import in your game as follow

C++

...
// 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.

Lua

...
-- 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)

用法

  1. release中下载AnimatePacker4
  2. 使用 TexturePacker 来打包你的帧动画的所有帧到一个 .plist和一个 .png文件
  3. 拖拉你的.plist文件到AnimatePacker4中
  4. 编辑你的动画,延迟,名字。 同时支持多个plist混合使用。
  5. 点击File-Save来保存你的动画为一个.xml文件(事实上是一个Apple-plist格式的xml)
  6. 保证全部你用到过的.plist文件和.png文件都在你的游戏的res/目录或者类似目录下
  7. 在代码中导入,使用。 示例代码如上面所示。

Note

  • JS is also supported but I don't write js.
  • HUGE shout out to origin author

animatepacker4's People

Contributors

hellokenlee avatar gdgoldlion avatar

Stargazers

伏毅 avatar  avatar

Watchers

 avatar

Forkers

brucelevis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.