Hi. I'm new to the concept that a SpriteBatch represents. What I could understand hitherto is that I can minimize the number of "draw" operations by using a SpriteBatch to make a lot of copies of the same sprite and then draw all of them with a single draw call.
If I'm right about that, then comes the question: I know I can get a huge speedup when I used a SpriteBatch to draw a map from a tileset that is a texture atlas but, as far as I understand, if instead of that each tile is in a different file, then I need to have a SpriteBatch for each of the files and call a lot of draws, making my program slow. Is this right? And if it is, why? I mean, is it not possible to make something that allows me to reduce the number of draws if I'm using lots of different texture files? And does that mean that if I had a HUGE file with all textures that I need to draw then I would be able to draw everything with a single SpriteBatch and the performance would be optimal?
I wonder if this subject sounds too obvious to you guys, but I still can't get my head around this.
About using SpriteBatch
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: About using SpriteBatch
Not sure if i understood, but you could in a loading screen draw your map to a canvas and then use it as a single giant texture. Probably not a good approach, perhaps someone else can provide a better answer!
https://github.com/Sulunia
Re: About using SpriteBatch
Exactly. Look up 'spritesheet' maybe. This is what 2d games (and websites btw) were made with for a long time btw.scoobyff666 wrote:And does that mean that if I had a HUGE file with all textures that I need to draw then I would be able to draw everything with a single SpriteBatch and the performance would be optimal?
Who is online
Users browsing this forum: No registered users and 0 guests