mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-08-12 12:29:42 +00:00
fix: new generator script and refactor
This commit is contained in:
parent
3e00029466
commit
7f52cabfbd
13 changed files with 219 additions and 42 deletions
15
generator/scripts/spritesheet.js
Normal file
15
generator/scripts/spritesheet.js
Normal 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!");
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue