Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

qertis/cc_spriter

Repository files navigation

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.