PDA

View Full Version : Arranging Sprite Frames Into A Single Image


Headless
03-05-2005, 08:03 PM
A group of us are making a 2D game for uni coursework and i'm doing the characters for it by rendering out 3D animated characters to sprites. The programmer in our group has specified that as per usual with sprite animations in 2D games, each frame of each motion needs to be laid out within a 512 x 512 pixel texture so that the engine can read through the image from the top left corner to the bottom right, like reading a page in a book, and displaying each image as it reads them in. This is how he suggested we go about laying the frames out...

http://legion.gibbering.net/headshot/cavemen.jpg

I was wondering if people had any adivice on how to go about taking the frames I have as they are in individual files to laying the frames out into a single image like the above, but doing it in an automated way like with an action or something. I know I could do this by hand but I have tons of animations with lots of frames each and I don't have time to manually place hundreds of animation frames. Here's an example of one of my frames...

http://legion.gibbering.net/headshot/shoot0014-1.jpg

Cheers.

EDIT - An important thing I forgot to mention: Each frame file not only has the frame image but an alpha channel for transparency and both of these need traslating into the single image.

Stroker
03-05-2005, 09:37 PM
I did buttloads of those by hand. Some nights without sleep. By hand because of the anti-aliasing in the alphas. Long story.

There is a batch script/macro/command somewhere in Photoshop that does index images. You should be able to trick it into doing your grunt work. Might have to do the images and alphas seperately, though.
I think it's called Contact Sheet...?

Swizzle
03-05-2005, 11:43 PM
Contact Sheet would probably be the way to go for something like this. Go to File>Automate>Contact Sheet and then select the folder that you want it to work from. Contact sheet will arrange your images in a grid and you can even add captions and stuff. Make sure you make a folder with all the images you need so that you'll have an easier time doing it. Most of the stuff in the dialog box if fairly self-explanatory, so you shouldn't have too hard of a time. Come back here if you need more help!

Headless
03-06-2005, 11:50 AM
Cheers guys, that's exactly what I was looking for.

:)

Headless
03-06-2005, 02:39 PM
Ok scratch that, it's not quite what I need. I need to keep the frames the same size as they are in the sprite images and the contact sheet resizes them to fit them into whatever column setup you have set, so I need to stop it from doing that or find an alternative.

Stroker
03-06-2005, 03:54 PM
Sounds like a math and/or camera problem.
Are all of your renders the exact same size?
Or have the same aspect ratio?

CGTalk Moderation
03-06-2005, 03:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.