Right now I am currently working on a game with my Australian buddy and I just am having such a difficult time with the spriting process. As the programmer of our game, it is my responsibility to get the sprites he models drawn and animated onscreen. However, the sprites he's drawing are huge images and the animation sequences are always at least 20 images wide, which means they're too big for the FileOpen method to read... Which brings me to my question: Is there a way to use a directory as the animation sequence? Like instead of stringing all the images together in a chain and animating the sequence, can I make an animation from a collection of the images in a folder?

For this example, use Animation.png to represent the chain of images version and Image1, 2, and 3.png for individual images in a directory.

Thanks in advance!

There are many ways to approach this problem, but first let's clear some things up:

  • Why are you using FileOpen? If you're programming XNA, you should use Content.Load<> instead.
  • Actually, it's a good idea if all your frames are stored in one big image. Just store the position for each frame in a file. For this, TexturePacker comes to mind. You might have to separate all frames and merge them all again, but it'll accomodate it a lot better, and output a nice XML (or whatever you want to use) file, with all info you'll need.
  • Sorry, I didn't actually mean to type that. I am using a Contentloader for all this. And I suppose I should probably do research instead of asking you to do it for me, but what exactly is a TexturePacker? – PorkchopDonut Jul 12 '13 at 4:49
  • @user32623 I bet it's an application that creates atlases from smaller textures. Not sure this does any good except for initial read time reduction these days with modern graphics cards. – user1306322 Jul 12 '13 at 7:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.