Re: Building a Board Game

2020-04-10 Thread Roger Guay via use-livecode
Thank you, Quentin. I’ll give it a try. Roger > On Apr 10, 2020, at 4:03 PM, Quentin Long via use-livecode > wrote: > > On 7.04.20 22:24, Roger Guay via use-livecode wrote: >> 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

Re: Building a Board Game

2020-04-10 Thread Quentin Long via use-livecode
On 7.04.20 22:24, Roger Guay via use-livecode wrote: > 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? There are any number of ways to

Re: Building a Board Game

2020-04-08 Thread Bob Sneidar via use-livecode
If you decide on that method, check out dragImageOffset. Bob S > On Apr 8, 2020, at 7:22 AM, Roger Guay via use-livecode > wrote: > > I like it! Thanks!! > > Roger > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit th

Re: Building a Board Game

2020-04-08 Thread Roger Guay via use-livecode
I like it! Thanks!! Roger > On Apr 8, 2020, at 7:10 AM, Bob Sneidar via use-livecode > 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 a

Re: Building a Board Game

2020-04-08 Thread Bob Sneidar via use-livecode
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 wrote: > > Just brainst

Re: Building a Board Game

2020-04-08 Thread Richmond via use-livecode
That could be a hexagon instead of a square. On 7.04.20 22:24, Roger Guay via use-livecode wrote: 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 mo

Re: Building a Board Game

2020-04-07 Thread Richmond via use-livecode
Um . . . http://forums.livecode.com/viewtopic.php?f=7&t=33886 Rough morning! Best, Richmond. On 7.04.20 22:24, Roger Guay via use-livecode wrote: 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

Re: Building a Board Game

2020-04-07 Thread Roger Guay via use-livecode
Thanks to Tore, Bob and Devin for your suggestions. You have pushed back my frontiers of ignorance! Cheers, Roger > On Apr 7, 2020, at 12:24 PM, Roger Guay via use-livecode > wrote: > > Hi all, > > I know there must be a simple way to do this but it is escaping me at the > moment. How can

Re: Building a Board Game

2020-04-07 Thread Devin Asay via use-livecode
Roger, Rather than moving an object, think about using button icons. This is the basic process: - on mouseDown: check the icon of the target, set the icon of a hidden, moving button to the same icon, set the icon of the target to 0, set a flag—isDragging--to true, show the hidden button - on

Re: Building a Board Game

2020-04-07 Thread Bob Sneidar via use-livecode
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 t

Re: Building a Board Game

2020-04-07 Thread Tore Nilsen via use-livecode
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