Seth Falco
Seth Falco

Reputation: 620

libGDX: How to disable the color on SpriteBatch?

With some assets, I'm trying to implement is so that I have a grayscale image, and use the Batch#setColor method to paint over it programmatically.

However, can Batch#setColor be disabled afterwards for rendering of the rest of the assets? I only want certain assets to render with the colored overlaid, not everything else as well.

I'm failing to see how to disable it, but I assume there must be a way?

Upvotes: 0

Views: 114

Answers (1)

Tenfour04
Tenfour04

Reputation: 93511

The batch's set color is multiplied by the color of the sprite, so to "disable" it, set it to white.

batch.setColor(Color.WHITE);

Upvotes: 1

Related Questions