spritesmith-texturepacker
Version:
Export TexturePacker compatible sprite sheets with SpriteSmith
48 lines (33 loc) • 1.29 kB
Markdown
TexturePacker export template for SpriteSmith!
This very tiny module makes exporting TexturePacker compatible JSON sprite sheets
with [grunt-spritesmith](https://github.com/Ensighten/grunt-spritesmith) or
[](https://github.com/twolfson/gulp.spritesmith). Just pass
it along via the `cssTemplate` parameter.
Building a TexturePacker sprite sheet with [gulp](http://gulpjs.com).
```js
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/'));
});
```
With npm:
```
npm install spritesmith-texturepacker
```
Copyright (c) 2014 Mark Riedesel
Licensed under the MIT license.
[]: https://www.npmjs.org/package/spritesmith-texturepacker
[]: http://img.shields.io/npm/v/spritesmith-texturepacker.svg?style=flat
[]: http://img.shields.io/npm/dm/spritesmith-texturepacker.svg?style=flat