Building a Board Game

Bob Sneidar bobsneidar at
Wed Apr 8 10:10:05 EDT 2020

I was also thinking that hiding the object and using the dragImage might be better, because if a the player drops a piece on an illegal position, you could simply cancel the drag operation and show the original object. 

Bob S

> On Apr 7, 2020, at 12:36 PM, Bob Sneidar <bobsneidar at> wrote:
> Just brainstorming, you would have to intercept mouseMove and then have a tolerance of points to your grid. Say three points. Assuming your grid starts at the top left of the window, you would div the top of the object with the vertical grid width, check for tolerance above and below, then set the object’s top to the nearest gridline. You will also need to set the mouseLoc by the same amount, or else capture the mouseLoc on mouseDown, record the distance from the top left of the object, then after setting the top left of the object, opined the mouseLoc to the object again. Do the same with left, and also with bottom and right if need be. 
> Bob S

More information about the use-livecode mailing list