Snap to grid/position

I looked all over for something like this, but could not find what I needed.

I need help making a simple function that will move an object (snap) to which ever column is is closest to.

Like a drag and drop Tetris for example, you can move your object anywhere, but when you let go it snaps to the closest column.
Ideas? [import]uid: 7850 topic_id: 8318 reply_id: 308318[/import]

jmp909 posted a nice code sample for such a problem: http://developer.anscamobile.com/forum/2011/03/16/dropping-image-only-predefined-areas-seen-board-games#comment-28043 [import]uid: 42078 topic_id: 8318 reply_id: 29711[/import]

VERY helpful!!

Thank you! [import]uid: 7850 topic_id: 8318 reply_id: 29726[/import]