object beneath mouseLoc?

J. Landman Gay jacque at hyperactivesw.com
Tue Jul 5 01:21:00 EDT 2011


On 7/4/11 7:59 PM, Nicolas Cueto wrote:
> Well, my solution was to use Jacqueline's idea of polling all the
> controls for an "if within". Also followed Dave Cragg's advice about
> mouseLoc (x,y) values.

That's how my Klondike solitaire game worked too, using a flag if the 
mouse was down and the x,y coordinates passed by mouseMove. You asked 
about "dozens" -- it depends on where you are in the game. There are 52 
playing cards in a deck and depending on how the card piles are 
arranged, I sometimes needed to poll most of them, especially if nothing 
had been played on any aces yet.

> Stack works fast. But on machines that are VERY old...

It was fast back in 2002 when I wrote it in MetaCard too. The polling 
was never a problem. The mouseMove handler had to drag up to a dozen 
cards behind it if the user wanted to move a long pile to another 
column, and originally that part did lag a bit, you could see the line 
of cards sort of fan out behind the drag, but on today's machines that 
doesn't happen any more. The response is smooth.

Klondike is uploaded to OnRev if you want to look, but it sounds like 
you've got it figured out now.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list