lepton
lepton

Reputation: 714

Is it a bad idea to use a SpriteBatch at same time as a SpriteCache in libGDX?

As per title. Would it be a bad idea to use a SpriteCache to draw textures that don't change (like a full screen background, graphics for a score panel) and also use a SpriteBatch for all other textures?

Upvotes: 0

Views: 173

Answers (1)

Tenfour04
Tenfour04

Reputation: 93759

That's fine, but you can't overlap their begin/end blocks, so there will be limitations in draw ordering.

But if it's just the stuff you listed, you're talking about a trivial number of sprites. There won't be any perceivable performance difference, so it is not worth the hassle. SpriteCache is for things like a large tile map for a stage that contains many sprites.

Upvotes: 1

Related Questions