Is it possible to use object:localToContent() on an event?

I've got a physics object in a group, and that physics object has an X coordinate of 1900. When I try to drag it (using dragBody() from gameUI), it flips out and does all sorts of weird things.

It appears to be because the event.x is within the screen coordinates (0 to 480), while the object is using a different coordinate system (being in a group), and is at 1900. So, the Touch Joint is being created with the wrong coordinates and/or the X and Y are being updated with the wrong coordinates during the drag.

Does anyone know how to fix this? I've played around with object:localToContent() and object:contentToLocal() for hours and hours, and I'm just not getting anywhere. Any help would be GREATLY appreciated.

event.target.parent:contentToLocal(event.x, event.y) should bring the coordinates to the same scope as the target object.

Wow, it worked!!! cixate, thanks a lot! I have been banging my head on the wall, trying to get this to work, for more than a week! We just started a new project, and we haven't been able to work on it all, because everything revolves around getting this to work.

So, I really, REALLY appreciate you taking the time to help!!!

views:1546 update:2011/11/10 9:30:09
corona forums © 2003-2011