Cocos2D JS Spriter SCON Implementation 🚢
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
demo
dist
.bowerrc
.editorconfig
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
bower.json
cc_spriter.js
package.json
webpack.config.js

README.md

Spriter Cocos2d 3.x

Based on spriter.js SCON Implementation. Discuss forum

Build Status Dependency Status devDependencies Status Codacy Badge

Install from Bower

bower install cc_spriter

Usage

Include cc_spriter_min.js in project.json

"jsList": [
  "cc_spriter_min.js"
]

Example

const spriter = new cc.Spriter(pathToScon);
spriter.setEntity(entityName);
spriter.setAnim(animationName);

API

spriter.setLoop(Boolean);
spriter.pause();
spriter.resume();

Development

Need dependencies:

  • node >= 6.0
  • Bash Shell
  • JAVA
  • Google Closure Compiler
  • compiler.jar
    • send compiler.jar to directory bower_components/google-closure-library/
    • rename closure_compiler file to compiler.jar

Setup:

npm i

Compile source code with Google Closure

npm run compile

Project structure:

β”œβ”€ dist/
β”œβ”€β”€β”€β”€ cc_spriter_min.js
β”œβ”€ bower_components/
β”œβ”€β”€β”€β”€ google-closure-library/
β”œβ”€β”€β”€β”€β”€β”€ compiler.jar
β”œβ”€β”€β”€β”€ spriterjs/
β”œβ”€ demo/
β”œβ”€β”€β”€β”€ .cocos-project.json
β”œβ”€β”€β”€β”€ res
β”œβ”€β”€β”€β”€ index.html
β”œβ”€β”€β”€β”€ main.js
β”œβ”€β”€β”€β”€ project.json
└─ cc_spriter.js

Features

  • Canvas 2D and WebGL supports
  • No global dependencies
  • ~62kB size

License

cc_spriter is MIT licensed.