I have a set up with a bunch of buttons with an image of a matchstick set as the icon. I can make these move with
Code: Select all
on mouseDown
Grab me
end mouseDown
I tried this at first:
Code: Select all
on mouseUp
if the loc of me is <20 graphic "Grid V1" then
set the loc of me to loc of graphic "grid v1"
"Grid V1" refers to a bunch of equal sized lines I made and arranged like a grid. The idea is that you can snap the matches to the grid lines, and they will automatically rotate to fit onto that section of the grid.
But obviously that isn't the correct way to phrase that. I googled around and found something that kind of works, but it doesn't work all the time:
Code: Select all
on mouseUp
if abs(item 1 of the loc of me - the left of graphic "Grid V1") < 20 then
set the loc of me to loc of graphic "grid v1"
Is there some way I can get the matches to snap to the grid and rotate to be the same rotation as the grid line? Thank you
