fun with emerging stacks

Wouter wouter.abraham at pi.be
Wed Aug 18 11:12:25 CDT 2004


For those who like things coming out of thin air.
Place the following in a button named "fader":

/*  place this one in the card script or in an existing preOpenStack 
handler
on preOpenStack
   send "startTheProcess" to btn "fader"
end preOpenStack
*/

on startTheProcess
   set the loc of this stack to -1000,1000
   set decorations of this stack to noshadow,empty
   doCapture
   send  "fadeIn" to me in 100 millisecs
end startTheProcess

on doCapture
   put the screenloc into tSL
   put the width of this stack div 2 into tW
   put the height of this stack div 2 into tH
   put item 1 of tSL - tW,item 2 of tsL - tH,item 1 of tSL + tW,item 2 
of tsL + tH into tRect
   if the width of this stack mod 2 = 1 then add 1 to item 3 of tRect
   if the height of this stack mod 2 = 1 then add 1 to item 4 of tRect
   import snapshot from rect tRect
   choose browse tool
   set the name of last control to "tempimage"
   set the blendlevel of img "tempimage" to 0
   set the loc of this stack to the screenloc
end doCapture

on fadeIn
   if there is an img "tempimage" then
     set the blendlevel of img  "tempimage" to (the blendlevel of img 
"tempimage" + 2)
     if the blendlevel of img "tempimage" < 100 then send "fadeIn" to me 
in  20 millisecs
     else
       delete img "tempimage"
       if the decorations of this stack = noshadow then set the 
decorations of this stack to default
     end if
   end if
end fadeIn

on mouseUp
   if the decorations of this stack = noshadow then
     set the decorations of this stack to default
     if there is a img "tempimage" then
       delete img "tempimage"
     end if
   else
     answer "Do you want to do it again?" with "No" or "Ok"
     if it is "Ok" then
       send "startTheProcess" to me
      end if
   end if
end mouseUp

It is just an experiment and it performs well on Mac OS X.
But it is not tested on other platforms yet.
So please....
TIA,
WA



More information about the use-livecode mailing list