This Grunt task converts .ase files to .png/.json file pairs which can be loaded as SprigganJSContentSpriteSheets.
The aseprite executable should be accessible via the command line; ensure that "aseprite -?" displays details on how to use aseprite's command line interface.
I would recommend adding Aseprite to the PATH environment variable, or adding a symbolic link or shortcut to where it is installed.
module.exports = function(grunt) {
grunt.initConfig({
"sprigganjs-aseprite": {
a: {
files: [{
expand: true,
src: "**/*.ase",
dest: "dist",
cwd: "assets"
}]
}
}
})
}
This takes every .ase file in the "assets" directory and its subdirectories, and creates .png/.json files in the "dist" directory:
Given "assets/subdirectoryA/subdirectoryB/test.ase", creates
- "dist/subdirectoryA/subdirectoryB/test.png"
- "dist/subdirectoryA/subdirectoryB/test.json"
Which can be loaded using:
new SprigganJSContentSpriteSheet("dist/subdirectoryA/subdirectoryB/test")
Every "tag" in the timeline is exported as an animation using the tag's name.
The centre pixel is the "origin" of the sprite.