How to implement drop targets?

I’m struggling to implement drop targets using Corona. The FollowMe (now renamed to DragMe) example shows how to do dragging, but the objects are droppable everywhere in this example. In my case, I need to the display object to be only droppable on a set of other objects. So far, my only solution is to hard code the location of the drop targets and explicitly compare the location of the dragged object against those. This works, but is far from a nice solution.

It would be much more useful if I could do hittests myself, to get a list of objects at a certain location. But I haven’t been able to spot an API that allows you to do that.

Anybody else found a better solution for this? [import]uid: 6795 topic_id: 1883 reply_id: 301883[/import]

The object.stageBounds API will give you the location of an object. You can keep a table of your drop targets and compare their locations to the location of the dragged object.
https://developer.anscamobile.com/content/display-objects#object.stageBounds

You may want to look at Game Edition and see if that would better suit your needs.

-Tom [import]uid: 7559 topic_id: 1883 reply_id: 6200[/import]

Thanks Tom.
stageBounds API is useful for rectangular objects, but not for curved onces. For that, being able to explicitly hit-test would be needed. [import]uid: 6795 topic_id: 1883 reply_id: 6327[/import]