Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Blink effect
- - By SPK Date 2013-05-18 17:59
Hello,

I need a blink effect (or called flash?) like the one used here: http://www.youtube.com/watch?v=go7rlvyI7Ys
I tried it using Texplay, but it's kinda limited. I coulnd't find a way to turn my image all white and slowly change it back.
My approach then was to copy my image, draw it over my original image and make it from white to 100% opacity. But
I noticed that's not the best performant way and I wasn't even able to turn my image white or change it's opacity... instead I drew a reddish rectangle on top
of my CLONED image. Then I switch between those two images every x frames to simulate a blink effect. Well, ...

can anyone suggest a better way to implement a blink using Texplay?
Parent - - By lol_o2 Date 2013-05-18 18:14
Try Ashton: http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?tid=784
You just need a proper shader. And it's better to give up on TexPlay, because it's very slow.
Parent - By SPK Date 2013-05-18 18:23
Thanks for the fast answer.

Pitty it's the first time I hear about it. I'll report back, once I tried it out.
Parent - By SPK Date 2013-05-18 19:41 Edited 2013-05-18 19:46
Awesome. Ashton::Shader(fragment: :fade) provides everything I need. Though, the syntax is a bit special and the Ashton source files doesn't really help.

However, I got what I asked for. Thousand thanks. :-)
Parent - By jlnr (dev) Date 2013-05-19 02:58
There are always many fun ways to implement visual effects... :) You can also create the white image once using TexPlay or even pure Gosu:

http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?pid=6425

And then overlay the white image over the original with a changing alpha value (or the other way around). However the Ashton solution should handle semi-transparent pixels a lot more nicely.
Up Topic Gosu / Gosu Exchange / Blink effect

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill