SFML community forums

Help => Graphics => Topic started by: dk123 on October 01, 2015, 02:42:15 am

Title: Question on setColor
Post by: dk123 on October 01, 2015, 02:42:15 am
Hi, it currently seems that setColor on a sprite works so that the colour argument is multiplied against the original colour of the sprite texture.

Would it somehow be possible to make this additive instead?
(In which case setColour would need to take in rgb arguments of the range -255~255 to cover all colours possible)
Title: Re: Question on setColor
Post by: DarkRoku12 on October 01, 2015, 05:46:29 am
Is because you tint the image instead of changing the color.

There is no way, yet, but i believe if you use external libraries for modify the texture, or use shaders you can get a sort of that you want.
Title: Re: Question on setColor
Post by: Laurent on October 01, 2015, 07:44:13 am
You can simply draw a sf::RectangleShape with the desired color and one of the several blend modes available (add / subtract in your case) on top of your sprite.