grunt-sprigganjs-aseprite

0.0.4 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-sprigganjs-aseprite

Weekly Downloads

4

Version

0.0.4

License

MIT

Last publish

Collaborators

  • jameswilddev
  • sunruse-ci