2D Toolkit Forum
2D Toolkit => Support => Topic started by: drGsus on February 27, 2012, 04:07:08 pm
-
Hi unikron,
I would like to cause a "blinking" effect, in which a hit enemy starts to blink white. My problem is, that the color value on a sprite, cant really overlay a color over the sprite. White shows me the exact original color values, and every other color modification just change the tint towards the specified color, except black of course.
Is it somehow possible to "overlay" a color over the sprite?
Thanks
-
I will need to investigate this further. It is actually possible to do this without breaking batching using one material as other objects, but I will need to work out the best way to achieve this without breaking everything!
-
Hi,
This isn't possible using the current shaders, premultiplied or otherwise. Here are some steps to get the effect using a custom shader -
1. Turn off premultiplied alpha on your sprite collection and click commit.
2. Add this shader to your project
3. Manually switch the shader in the material attached to the sprite collection to this shader (BlendAddColor)
.rgb colors will be additive (black = original image, white = fully white), whereas .a is multiplied. So you can still do flashing objects which are fading away simultaneously.
Hope this helps.
-
Thats amazing unikron,
thank you very much :)
-
Hi Unikron,
I know this is old, but I'm having the same problem trying to make a white overlay, and I don't know how to get that shader you've made.
Can you get that for me? I'm quite a noob here, but I think I"ve understood the problem.
Thanks!
-
You will need to register your copy to get download access.
http://2dtoolkit.com/forum/index.php/topic,34.0.html
-
Thank you so much, this helped a lot! :)
-
So, I can't see the download link.
I'm already a registered member. It says:
"Current Membergroups
Registered Members
Every member of the forum is a member of this group."
And still I can't see the download link. In fact, I think I've never seen any download links here, but I never needed to.
How may I download this shader? Thanks.
-
You will need to register your copy of 2D Toolkit
http://2dtoolkit.com/forum/index.php?index.php/topic,34.0.html