Page 1 of 1

Fading "About..." window

Posted: Thu May 22, 2008 3:21 pm
by gyroscope
Hallo, if a user clicks on my About screen, I would want it to fade to nothing.

I've done a few tests, using a transparent image, and alphaData in scripting, etc but have had no luck.

I can make the window totally disappear with a totally transparent image but can't make it reappear (in other words, if I could get this way to work, I then know I could get it to work the other way that I want, slowly fading then closing, after a user mouse click).

I'd appreciate any help/guidance here, thanks!


:)

Posted: Thu May 22, 2008 4:02 pm
by Tim
Try this in your stack script:


-------------------------------

local gBlend

on mouseUp
put 0 into gBlend
send "blendOut" to me in 10 milliseconds
end mouseUp

on blendOut
add 5 to gBlend
set the blendlevel of this stack to gBlend
if ( gBlend < 100 ) then
send "blendOut" to me in 10 milliseconds
end if

end blendOut

---------------------------------

Regards,

Tim

p.s. Please note, if you are running on Linux, this will only have an effect if you are running a composite window manager.

Posted: Thu May 22, 2008 8:08 pm
by gyroscope
That's brill, Tim!

Thank you very much indeed, I've been wanting to fade a window for a few weeks now, and your code works perfectly! 8)

Excellent stuff, thanks again (you can tell I'm pleased!) :D

Re: Fading "About..." window

Posted: Fri Jul 29, 2011 1:56 am
by BarrySumpter
Postby Tim ยป Fri May 23, 2008 1:02 am
Try this in your stack script:
-------------------------------
Easier to read:
-------------------------------

Code: Select all


local gBlend

on mouseUp
     put 0 into gBlend
     send "blendOut" to me in 10 milliseconds
end mouseUp

on blendOut

     add 5 to gBlend
     set the blendlevel of this stack to gBlend
     if ( gBlend < 100 ) then
          send "blendOut" to me in 10 milliseconds
     end if

end blendOut