Detecting a "grabEnter"?

Scott Rossi scott at tactilemedia.com
Wed Sep 3 13:20:08 EDT 2008


I'd say there is virtually no difference between grab/mousemove, or at
least, I've never seen one.  Perhaps this is more evident on older systems.
I was going to say that *maybe* creating some demanding display calculations
by dragging a large image with varying translucency over a second large
image could cause some lag, but trying it just now I can't see any
noticeable difference between grab/mousemove (Rev 2.9).  Perhaps Bjornke you
could produce a demo stack that demonstrates the lag?

In any event, for me, having access to mouse events and virtually all engine
messages far outweighs what little performance benefit there may be in using
grab, if any.  The fact that the question "How do you do XYZ while using
grab?" comes up so often on this list seems to indicate that the grab
command may be of little use in practical applications.

And as far as using repeat loops and polling the mouse state goes, this has
already been discussed.  The original developer of the MetaCard/Revolution
engine said not to do it, so I don't. :-)


Recently, Richard Gaskin wrote:

>>> It's generally considered better practice to use these four handlers
>>> for  custom dragging operations:
>>> 
>>> mouseDown -- to set a flag
>>> mouseMove -- checks the flag and does the work
>>> mouseUp -- clears the flag
>>> mouseRelease -- also clears the flag
>> 
>> Yes but that method will lag much more then using grab, viewable by
>> the lone eye, while most users will never notice the huge processor
>> load when using a repeat loop. As a game oriented developer, I prefer
>> the second back draw.
> 
> If a drag is complex enough it would seem that choking the processor
> might also have an adverse effect, though I can't say I've done
> benchmarking under such circumstances; it's hard to measure things
> involving user interaction.
> 
> The demos Scott Rossi kindly put together using the four-handler method
> seem quite responsive:
> <go url "http://www.tactilemedia.com/download/drag_sample.rev">
> 
> Rossi and Malte have done far more with dragging than I - you guys got
> any input on this?


Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list