Possible to find the Display x/y of a physics body?

For a physics body, I can get the x/y which I believe are its World coordinates. However, what if I want to get it's coordinates on the Display itself, between 0,0 and 480,320 (for example)?

It this possible?

have a look at the contentToLocal and the localToContent functions, are they what you are after?

cheers,

?:)

Terrific! localToContent did the trick.

I have a body in the physics world, and I needed to know where it appeared on the actual screen in terms of which "section" of the screen it was in, left side, top, right side, bottom.

So, the body was added in the displayGroup "thegroup" as "thebody"

This is what worked:

1
2
local x_local, y_local = thegroup:localToContent(this.thebody.x, this.thebody.y)
-- x_local and y_local were the screen coordinates of the body
views:1610 update:2011/10/4 8:06:35
corona forums © 2003-2011