Fading "About..." window

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Fading "About..." window

Post by gyroscope » Thu May 22, 2008 3:21 pm

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!


:)

Tim
Posts: 29
Joined: Wed Oct 31, 2007 12:56 pm

Post by Tim » Thu May 22, 2008 4:02 pm

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.

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Thu May 22, 2008 8:08 pm

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

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Fading "About..." window

Post by BarrySumpter » Fri Jul 29, 2011 1:56 am

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 
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply