Sign in to follow this  
TheCompBoy

Sprite sheets?

Recommended Posts

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!

Share this post


Link to post
Share on other sites
[quote name='TheCompBoy' timestamp='1312664819' post='4845540']
I wonder.. Whats the pros / cons of using theese?
[/quote]

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.

[quote]
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).

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

Google probably has a few million.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
On embedded systems, sprite sheets are efficient because you can do away with redundant texture binding calls, which can be a significant overhead.

Share this post


Link to post
Share on other sites

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