Building a Board Game

Tore Nilsen tore.nilsen at me.com
Tue Apr 7 15:33:47 EDT 2020


What I do is to make a grid of named rectangles (they may or may not be visible). I put the names of these into a variable or an array. On mouseUp I traverse the variabel/array to check if the mouseLoc is within any of the rectangles. When there is a match I set the loc of the grabbed control to the loc of the matching rectangle. 


Regards
Tore Nilsen
> 7. apr. 2020 kl. 21:24 skrev Roger Guay via use-livecode <use-livecode at lists.runrev.com>:
> 
> Hi all, 
> 
> I know there must be a simple way to do this but it is escaping me at the moment. How can I move an object (grab me on mouseDown) and have it snap to a grid (square on a board game) on mouseUp?
> 
> Thanks much,
> 
> Roger
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list