Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Loew CodeAndWeb

View GitHub Profile
@sergebat
sergebat / pack-all-spritesheets.js
Last active Aug 10, 2017
Pack images from each subfolder into individual spritesheet with texture packer
View pack-all-spritesheets.js
// Iterate all folders inside resources/img/source/
// Pack all images inside each folder with TexturePacker
// Put each individual spritesheet into resources/img/output (spritesheet name = folder name)
// Example:
// Source folders: resources/img/source/level1, resources/img/source/level2, resources/img/source/level3 ==>
// Output: resources/img/output/level1.json + png, resources/img/output/level2.json + png, resources/img/output/level3.json + png
const sh = require("shelljs");
sh.pushd("resources/img/source/");
sh.ls("-d", "*").forEach(