Sign in to follow this  

The "right" way to load in sprites

This topic is 4685 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

I'm currently using the sprite classes from cone3d...becuse I'm lazy...and havent had any motivation to make my own...but I've heard that the way to load sprites by cone3d isn't good...how would you do this the "right" way? //walle

Share this post


Link to post
Share on other sites
I never much liked the Cone3d method either. For the game I'm working on now I wrote a small utility that allows me to load in a big bitmap and select frames for animation by pointing and clicking. I use the utility to set the frame delay and to see a preview of what it will look like in the game.

My sprite class is pretty simplistic. I store each frame in a vector of BITMAP pointers (using Allegro, obviously this would change depending on which API you're using). The sprite class reads a ".spr" file which stores the x,y,w,h, of each frame of animation, the total frame count, and the frame delay.

That's really all there is to it. I don't know if it's the "right" way, but it works, it's fast, and it's easy to use.

Share this post


Link to post
Share on other sites

This topic is 4685 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this