Building a Board Game
irog at mac.com
Wed Apr 8 10:22:20 EDT 2020
I like it! Thanks!!
> On Apr 8, 2020, at 7:10 AM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 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 iotecdigital.com> 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
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode