# \[mx\] Snap a shape to another Object

**URL:** <https://forum.kirupa.com/t/mx-snap-a-shape-to-another-object/97240>\
**Category:** Uncategorized\
**Created:** [December 19, 2003, 11:09am UTC](https://forum.kirupa.com/t/mx-snap-a-shape-to-another-object/97240 "2003-12-19T11:09:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davymacca](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@davymacca](https://forum.kirupa.com/u/davymacca)\
**Post date:** [December 19, 2003, 11:09am UTC](https://forum.kirupa.com/t/mx-snap-a-shape-to-another-object/97240/1 "2003-12-19T11:09:17Z")

</div>

**I need some help** on a game that I am making. It is basically a puzzle game like a jigsaw. You have 30 pieces, 15 one shape and 15 another, to play with and you need to fill a certain shape.

Where I am at the moment:  
o 2 Buttons create the shapes  
o the shapes can be rotated whilst pressing the ‘Ctrl’ key

What I need is for the shapes to snap to each other. So when you put a shape within 5 or so pixels of another they snap to the edge coordinates of that shape.

Dose anyone even know the theory behind that or if in fact it can be done?? I have uploaded it cos I think my explanation of what I need is a bit crap.

cheers  
C:-)
