grunt-sprigganjs-aseprite
v0.0.4
Published
A Grunt task for converting Aseprite files to SprigganJS-compatible spritesheets
Downloads
4
Readme
grunt-sprigganjs-aseprite
This Grunt task converts .ase files to .png/.json file pairs which can be loaded as SprigganJSContentSpriteSheets.
Setup
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.
Grunt configuration example
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")
Aseprite-SprigganJS mapping
Every "tag" in the timeline is exported as an animation using the tag's name.
The centre pixel is the "origin" of the sprite.