HELP! - Display group does not have X & Y coordinates

Hi there,

I’m attempting to work with a ragdoll sample that was created in another thread
http://developer.anscamobile.com/forum/2010/10/29/new-corona-any-radgoll-examples

Seems like creating the doll is the easy part, but trying to read any of the doll’s coordinates in X&Y space isn’t working.

I call the function in the example using
[lua]local r = newRagdoll(160, 160)
print ( r.x ) [/lua]

but get an output of “0”

how can I read to coordinates of the ragdoll group that gets returned? [import]uid: 14327 topic_id: 5411 reply_id: 305411[/import]

Did you actually set the X/Y when you first created the group?

[import]uid: 11860 topic_id: 5411 reply_id: 18172[/import]

I’d tried that earlier and it didn’t work right, thought I couldn’t quite figure out what was going on.

I tried going ahead and setting ragdoll.x and ragdoll.y in the ragdoll creation function.
as it turns out, you can see what’s happening if you turn on

[lua]physics.setDrawMode( “hybrid” ) – overlays collision outlines on normal Corona objects[/lua]

Setting the XY of the ragdoll to ORIGINX,ORIGINY creates a separation between the doll and its wireframe of joints.

keeping ragdoll at 0,0 and putting everything else in place seems to be the answer in terms of making the frame work properly. So the question becomes how does one access the locally created members of a group?

For example -

[lua]local r = newRagdoll(100, 100)

if (r.head.x > 200) then
moveCamera
end[/lua]

unfortunately the above returns a nil object - so - how is data structured? it there a ‘members table’ within the display group?

I tried returning just the “head” from the function (which does have coordinates) - but the head and body now fall apart when throwing them.

[import]uid: 14327 topic_id: 5411 reply_id: 18180[/import]