A snapping puzzle to the grid

The draggable behavior works fine - until you have a hit box that is not a rectangle and the non-hit box area overlaps another shape (see: Click and Drag with overlapping objects). I ended up creating my own function to ensure that the object clicked is the object that is dragged. If you are interested, I can share the function later tonight (right now I am on an Amtrak and the internet connection stinks). I have another function that snaps to a grid but only when the dragged piece is entirely inside the “play area”.

Art.

1 Like