Skip to content

Instantly share code, notes, and snippets.

@cupools
Last active November 6, 2015 07:07
Show Gist options
  • Save cupools/6186ee161d4958cf0b5c to your computer and use it in GitHub Desktop.
Save cupools/6186ee161d4958cf0b5c to your computer and use it in GitHub Desktop.
test
/node_modules
var spritesmith = require('spritesmith'),
fs = require('fs');
// Generate our spritesheet
var sprites = [
'0.png',
'4.png',
'2.png',
'1.png',
'5.png',
'3.png',
];
console.time('t');
spritesmith({
src: sprites,
padding: 10,
}, function handleResult(err, result) {
fs.writeFileSync(new Date().getTime() + '.png', result.image, 'binary');
console.timeEnd('t');
});
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"spritesmith": "^1.4.6"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment