fix: new generator script and refactor

This commit is contained in:
trafficlunar 2024-12-22 15:58:02 +00:00
parent 3e00029466
commit 7f52cabfbd
13 changed files with 219 additions and 42 deletions

View file

@ -0,0 +1,15 @@
const fs = require("fs");
const path = require("path");
const spritesheet = require("spritesheet-js");
const INPUT = path.join(__dirname, "../blocks/");
const OUTPUT = path.join(__dirname, "../output/");
if (!fs.existsSync(OUTPUT)) fs.mkdirSync(OUTPUT);
spritesheet(path.join(INPUT, "*.png"), { format: "pixi.js", path: OUTPUT }, function (err) {
if (err) throw err;
console.log("Done!");
});