Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A Photoshop CS5 script for making sprites out of a pile of layers :D Assumes that the top layer is the first frame, bottom is the last. Based on this one: I just like my sprites to run vertically. I'm weird like that.
if (documents.length > 0)
var docRef = activeDocument;
var activeLayer = docRef.activeLayer;
numLayers = docRef.artLayers.length;
var rows = numLayers;
var spriteX = docRef.width;
var spriteY = docRef.height;
app.preferences.rulerUnits = Units.PIXELS;
docRef.resizeCanvas( spriteX, spriteY * rows, AnchorPosition.BOTTOMLEFT );
for (i=0;i < numLayers ;i++)
docRef.artLayers[i].visible = true;
var movY = spriteY*i;
docRef.artLayers[i].translate(0, -movY);
msg("Sorry must have more than 1 image open in photoshop to work!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment