Skip to content

Instantly share code, notes, and snippets.

@rossy
Created September 14, 2012 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossy/3721881 to your computer and use it in GitHub Desktop.
Save rossy/3721881 to your computer and use it in GitHub Desktop.
require("child_process").spawn(
"montage",
require("fs")
.readdirSync(".")
.map(function(a) {
return a.match(/^.*_Tile_([-\d]{3})_([-\d]{3})_LOD0\.dds$/);
})
.filter(function(a) { return a; })
.sort(function(a, b) {
var x1 = Number(a[1]),
y1 = Number(a[2]),
x2 = Number(b[1]),
y2 = Number(b[2]);
if (y1 == y2)
return x1 - x2;
else
return y1 - y2;
})
.map(function(a) {
return a[0];
})
.concat(["-geometry", "+0+0", "-tile", "32x32", "out.png"])
);
@Jakobud
Copy link

Jakobud commented Sep 16, 2012

Is it just me or are all the Indar_Tile tiles upside down? It seems they all need to be flipped vertically...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment