Sign in to follow this  

[.net] [XNA] Multiple Sprite Batches

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

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

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