Jump to content
  • Advertisement
Sign in to follow this  
walle

The "right" way to load in sprites

This topic is 4934 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
Advertisement
Well, if ur writing some tile based game then usually you would incorperate sprites (in groups) into a larger texture, not individually. If this isnt what u mean then u need to give more information.

ace

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!