Jump to content
  • Advertisement
Sign in to follow this  
QRebound

[.net] [XNA] Multiple Sprite Batches

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

Looked around for a bit, and I didn't see any other posts on these questions. Is there ever a situation in which you would need more than one sprite batch? If not, what would the affect of this be? Does the sprite batch automatically sort sprites that you "draw" with it? (I'm assuming that's what the sprite batch is _for_). Thank you :)

Share this post


Link to post
Share on other sites
Advertisement

I could see times when you would like to use more then one sprite batch, for example using different sprite blend modes...

But in general you really only need one. In regards to the ordering of the sprites, this is done in the way that you draw them on the screen (Your spritebatch.draw calls).

I have also used in some examples the one sprite batch to draw the background to a render target for some post processing, then re used the same sprite batch to draw the render target to the screen.... and finally the same sprite batch to draw the border or HUD that is not affected by the post process effect.

Here is a link to the sample I am talking about. XNA Post Processing Sample - Under Water

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!