Re: animation

emlowe@fsa.ca
Thu, 17 Aug 1995 13:39:31 -0700 (MDT)

>
> hi,
>
> does anyone know of any ingenious ways of getting an object to follow
> the cursor *smoothly* ? Getting a mousedown handler in the object to
> follow the mouseLoc doesnt give satisfactory results :(
>
> cheers in advance :)
>
> r.
>
>

As Scott Raney said, the following works well:

on mouseDown
repeat while the mouse is down
set the loc of me to the mouseLoc
end repeat
end mouseDown

However, let's say you wanted to display the current loc in a field,
so the script becomes:

on mouseDown
repeat while the mouse is down
set the loc of me to the mouseLoc
put the mouseLoc into field "blah"
end repeat
end mouseDown

This is so *unbearably* slow that it is completely useless. Even merely
putting a constant value into the field is as slow - it's the overhead
of the "put" command. Anything else with less overhead?.

Note that using an idle handler like mouseStillDown works better, but
is fairly chunky due to the idle time. (The idle time can be made
smaller, but I'm not sure what other effects this will have)

-Earle

-- 
Earle Lowe
emlowe@fsa.ca
FSA Corporation
Performance and system software for UNIX networks.