Sprite sheets?

Started by
3 comments, last by Tachikoma 12 years, 8 months ago
Hello peoples!

I see on the web when i want to get sprites there are like one big picture with many small pictures on it.. And they we're ofcourse called sprite sheets..

I wonder.. Whats the pros / cons of using theese?
And how would i use them? how do they work..?

Is there any links i can read about using them?

Thanks!
Advertisement

I wonder.. Whats the pros / cons of using theese?


They're one surface as far as your graphics api (usually) is concerned, that means it doesn't need to spend the time shifting a new bunch of bits to the graphics card in order to push the images to the screen, it just picks a different sub-set of the sheet. This is good.

They require some utility to composite them all into one sheet, and address the correct location for the correct image... and generally there's some coding overhead to deal with all that and the changes that come as the game is developed. That is the bad.


And how would i use them? how do they work..?
[/quote]

If you don't need them, don't use them. They work because either the sprite library you work with, or the graphics api lets you set texture coordinates to pull from the source image (your sprite sheet) when rendering. Instead of 0,0 to 1,1 you use .25,0 .50,.50 (or whatever subset of the sheet is the one image you want).


Is there any links i can read about using them?
[/quote]

Google probably has a few million.
Its mostly a convenience issue. You can have a whole bunch of images in a single texture file, and then just pull the section of it that you need.

I find them most useful for animations. Splitting the sheet into various frames of an animation, it is really easy to just store each frame in an array and cycle through them. Granted, you could get the same effect with all individual images, but why bother when you could just have one?
Never, ever stop learning.
- Me
I was using animation.. So thats why i needed some info like if this was making game faster or i don't know.. But i made my own sprite sheet now for the character and its working fine!
Now i just need to make some kind of map for the game and think out a fighting system..
On embedded systems, sprite sheets are efficient because you can do away with redundant texture binding calls, which can be a significant overhead.
Latest project: Sideways Racing on the iPad

This topic is closed to new replies.

Advertisement