Created
August 10, 2013 05:22
-
-
Save rachelnabors/6199180 to your computer and use it in GitHub Desktop.
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: http://www.garagegames.com/community/blogs/view/11527 I just like my sprites to run vertically. I'm weird like that.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
}else | |
{ | |
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