Aloha everyone,
I have a background image with a grid layout and would like to allow the user to move one of a set of buttons to specific grid locations, but only to those specific locations. In other words, say I wanted to limit the movement on the y axis to increments of, say 65 pixels, then snap the button to the closest point (if you moved it 67 pixels, it would snap back 2 pixels). Does anyone know how to accomplish this?
Aloha everyone, I have a background image with a grid layout and would like
Share
Below is some code I’m currently working with, it allows the user to drag and drop an image around the screen. You’ll notice the “if” statements with values set to “960” and “640” and such, this states that if the user attempts to drag the image off screen it animates the image moving back into the screen and can be easily modified to make the image move to the closest grid coordinate that the user dropped in near.