0.0.3 • Published 8 years ago
createjs-spritesheet-generator v0.0.3
createjs-spritesheet-generator
Create a Spritesheet from a folder of images via spritesmith
This project requires nodejs >= 8.1 incl. npm 5 to be installed.
Getting Started
Install the module with: npm i createjs-spritesheet-generator
const cjsSpritesheetGenerator = require('createjs-spritesheet-generator');
const options = {
dest: 'dist/spritesheets',
images: 'src/images@2x/*.png',
};
cjsSpritesheetGenerator(options);Documentation
createjs-spritesheet-generator exports the function cjsSpritesheetGenerator as its module.exports.
options
- dest:
StringOutput path, default:'./spritesheet' - images:
StringPath to input-images, supports globs, default:'./images/\*.png' - outImgName:
StringName of ss that will be generated without extension, default:'spritesheet' - verbose:
BooleanEn|disable logs to console, default: false - padding:
NumberSpace between sprites inpx- doubled for retina version, default:2 pngquantOptions:
ObjectWill be passed to imageminpngquant- quality:
StringImagequality, range between0..100, default:'30-75' - floyd:
NumberControls level of dithering, between0..1, default:1 - speed:
NumberSpeed between0..10- 10 is fastest with decreased quality, default:3
- quality:
retina:
StringRetina suffix - provide falsy value to disable retina support, default:'@2x'outDataExt:
StringExtension of generated data-file,'js' || 'json', also decides whichhbstemplate will be used, default:'json'outImgExt:
StringExtension of generated image-file,'png' || 'jpg', default:'png'- cssTemplate:
StringPath to custom handlebars template, default:''
0.0.3
8 years ago