Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

spritesmith-texturepacker

Klowner681.1.0

Export TexturePacker compatible sprite sheets with SpriteSmith

texturepacker, spritesmith, export, sprite, 2d

readme

SpriteSmith TexturePacker NPM Version NPM Downloads

TexturePacker export template for SpriteSmith!

About

This very tiny module makes exporting TexturePacker compatible JSON sprite sheets with grunt-spritesmith or gulp.spritesmith. Just pass it along via the cssTemplate parameter.

Example

Building a TexturePacker sprite sheet with gulp.


var spritesmith = require('gulp.spritesmith');

gulp.task('sprite', function () {
    return gulp.src('src/gfx/scubaman/*.png')
        .pipe(spritesmith({
            imgName: "scubaman.png",
            cssName: "scubaman.json",
            algorithm: 'binary-tree',
            cssTemplate: require('spritesmith-texturepacker') // <-- this right here
        })
        .pipe(gulp.dest('./dist/gfx/'));
});

Install

With npm:

npm install spritesmith-texturepacker

License

Copyright (c) 2014 Mark Riedesel Licensed under the MIT license.