SFML community forums
Help => Graphics => Topic started by: underww on November 29, 2013, 03:54:12 pm
-
I'm trying to make short white blink effect as a result of collisions.
but I can't change sprite's color to white because white color is default color on sprite class.
so, is there any solution for this problem?
Thanks and I'm sorry for my poor English, I hope you understand my question.
-
You can draw a white semi-transparent rectangle on top of your sprite. You can play with its alpha component to make it more or less transparent, create fade effects, etc.
-
Thanks for replying so quickly.
but another problem is that the sprite has alpha channel.
so, white semi-transparent rectangle makes background also white.
how can I handle this issue?
-
The simplest would be to have a separate texture where the sprite comes in white, and draw the white version on top of the normal one, possibly using alpha blending.
You could also use a fragment shader that makes the sprite appear white, but this requires knowledge about GLSL.