SFML community forums
Help => Graphics => Topic started by: flugsten on May 02, 2014, 09:39:04 pm
-
I am attempting to turn my player character whiter/brighter for a short while after taking damage and to turn buttons white on hover, however as the sprite color defaults to white I struggle doing so. Is there any easy way to make a sprite whiter? Thanks in advance.
-
One solution that comes to mind would be to use a shader. I'm not sure if there's an easier or better solution than that, though.
-
You could potentially start with a grey color applied to your sprite, thus you can make it whiter later on.
-
Draw a white version (either prepared outside the program, or built programmatically) of your sprite on top of the sprite itself, with sf::BlendAlpha blend mode. Adjust the sprite's opacity to your needs.
You can play with blend modes to find the perfect result. Note that the current development version has more blending options than the latest release.