• Advertisement
Sign in to follow this  

2d sprite animation

This topic is 4228 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys. I'm working on a Diabloesque game and I need some help with animating sprites. Well not really help, I've been able to animate a sprite by adjusing its rect each frame, but is this a good way to go about doing it? Is there a special file format for animated sprites or should I use gifs? If I use gifs how do I animate them? Thanks for any help or suggestions.

Share this post


Link to post
Share on other sites
Advertisement
The usual way is to store the sprites in one big texture, like images from a paper based flip book, then change the rectangle which gets displayed. You move the target rectangle on the screen to move the sprite and you move the source rectangle on the texture to animate it. The file format can be anything, even uncompressed raw binary data. Many games use tga because it supports 4 channels (red, green, blue and transparency also called alpha) and it's very easy to load the uncompressed rgba8888 variant.

Viktor

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement