animate light to dark
Michael J. Lew
michaell at unimelb.edu.au
Wed Sep 14 18:47:58 CDT 2005
Thanks Scott, your script works very nicely with small images.
Unfortunately, when I make the image as large as I want (about half
of the screen) it still shows flickery lines as it animates. However,
I've tried it on the Macs and PCs that the students will be using and
they are perfectly acceptable. It looks like my Mac has fallen a bit
too far behind the times! In a way, that makes things easy for me: if
my stacks work well enough here, they will certainly work well enough
in the student labs.
At 2:43 AM -0500 14/9/05, use-revolution-request at lists.runrev.com wrote:
>Recently, Michael J. Lew wrote:
>> I am trying to get a smooth animation of a background going from
>> light to dark (and vice versa), but I'm having trouble making it fast
>> enough, smooth enough and flicker-free.
>> What I need is to have a large dark region behind some images get
>> light over about half a second so that the transition doesn't look
>> too amateurish. I also need to be able to respond to messages while
>> the change in darkness is occurring.
>This last line is a significant hurdle. Being able to respond to messages
>means you can't use any of the built-in transitions. So you are correct to
>attempt to build the transition yourself.
>> I've tried playing with fill
>> colors of buttons and fields and with blendlevels of an image. I also
>> tried the straightforward approach of simply stacking a sequence of
>> buttons with different fill colors and hiding or showing them in
>> sequence. For every approach I've tried the transitions are good
>> enough with small areas, but when the objects are made large enough
>> for my purposes they are slow and yukky.
>Doing visual changes over large areas does indeed require more
>overhead/resources, as will accounting for a lot of controls. As far as
>what you describe above goes, here are some more efficient options:
>1) use a large image set to solid black (or whatever color is appropriate),
>and set its blendLevel repeatedly from 100 to 0 and then back to 100 again.
> put "" into fCount
> set blendLevel of img myFader to 100
> if fCount = "" then put 1 into fCount
> set the blendLevel of img myFader to abs(100 - (fCount * 5))
> # ADD YOUR ROUTINES HERE
> if fCount < 40 then
> add 1 to fCount
> initFader # MAKE CERTAIN MYFADER IS NOT VISIBLE
> exit fadeCard
> end if
> send "fadeCard" to me in 10 millisecs
>2) use a button (with all visible properties disabled) as an image display
>and set its icon repeatedly to a sequence of images as above (solid color
>images will be the most efficient)
>3) depending on what's happening on your card, you might be able to
>repeatedly set the backColor of the card from light to dark and light (as
>above) but obviously this will not obscure any controls on the card
>4) you might consider giving up the fade transition all together and instead
>simply lock the screen while popping up a separate "activity" window that
>displays an animation to draw users' attention away from the updating window
>Hope this helps.
>Tactile Media, Multimedia & Design
Michael J. Lew
Department of Pharmacology
The University of Melbourne
Phone +613 8344 8304
New email address: michaell at unimelb.edu.au
More information about the use-livecode