drag-and-drop for matching exercises
Posted: Thu Jan 29, 2009 6:03 pm
I’m creating educational drag-and-drop activities, such as matching exercises. I have no problem as long as the drop locations are rectangles. The intersect function works fine for that. But when the drop location is not rectangular, neither the intersect function nor the within function works quite right. I want a match to occur if any visible portion of the objects overlap when dropped. But the intersect function returns true if the dragged object is within the rectangle surrounding the drop location. So two circles, for example, intersect if they are just nearby each other. Similarly, the within function returns true only if the center of one object is within the other. That requires two circles, for example, to overlap quite a lot, not just a little. Is there any function (or trick) that will detect if two non-rectangular objects (circles, polygons) overlap at all, but not when they are just close to each other? Thanks in advance!