Threaded anim GIFs?

Richard Gaskin ambassador at fourthworld.com
Thu Jun 2 17:22:41 EDT 2005


Cubist at aol.com wrote:
> sez ambassador at fourthworld.com:
> 
>>I've noticed that animated GIFs only animate while the engine is idle --
>>anyone know a trick to get them to continue animating while the engine
>>is busy with a script?
>>
>>I'd like to use an anim GIF as part of a progress dialog, but I imagine
>>the engine could do a more efficient job than my scripts of changing 
>>frames if there was a built-in capability of doing so without having to
>>explicitely tell it each time.
> 
>    Stupid question: Is there any reason that something in this neighborhood 
> would be unsuitable to your purpose?
> 
> on AnimGif FrameNum
>   if FrameNum = "" then put 1 into FrameNum
>   set the frame of img "Fred" to FrameNum
>   put 1 + (FrameNum mod (the number of frames in img "Fred")) into FrameNum
>    send ("AnimGif" && FrameNum) to me in 100 milliseconds
> end AnimGif

When used in a repeat loop, the "send" will never be received until 
after the loop is done.  I can call it inside the loop, but it's just 
overhead compared to the greater efficiency of Trevor's request to have 
it in the engine.

When used outside of a repeat loop it'll work okay, but if we have 50 or 
100 such GIFs (think games) it'll bog down relative to what the engine 
could do for us.

--
  Richard Gaskin
  Fourth World Media Corporation
  __________________________________________________
  Rev tools and more: http://www.fourthworld.com/rev


More information about the use-livecode mailing list