Color sprite tint with opacity in MonoGame/XNA

Posted by Piotr Walat on Game Development See other posts from Game Development or by Piotr Walat
Published on 2012-10-21T07:52:34Z Indexed on 2012/10/21 11:22 UTC
Read the original article Hit count: 1581

Filed under:
|

In MonoGame I am using SpriteBatch to draw sprites. I want to create a semi transparent overlay that would 'tint' the sprite with a given color. SpriteBatch.Draw accepts Color parameter that allows to specify the tint, however the alpha channel seems to make the whole sprite transparent (not the tint only). To address the problem i am overlaying my sprites with another white, semitransparent sprite tinted to a given color. It works as expected, but I am not sure if that is the correct (ie. most optimal) approach. Can you suggest better/faster technique?

© Game Development or respective owner

Related posts about XNA

Related posts about monogame