john Mc kenna

john Mc kenna

  • NA
  • 11
  • 14.2k

Release mouse and object will move to nearest point

Feb 24 2012 6:00 PM
Hey guys...Im creating a board game and atm I can drag/drop the letters on tiles(on the board)...but what I want to know is how if i drop the letter on the tile, how can i get the letter to automatically position itself in the center of the tile (onthe board). So i can drop it anywher inside the tile and it will appear to drag itself into the center.

Is this done using rectangles for each tile, then find the center point of each rectangle and if the letter is dropped inside this particular tile then move it to the center.

I think i understanf the logic could anyone give me a startup on it or even point me in the direction of a tutorial ot two that uses this?

Thanks again

Answers (2)