Hi all,
I’m wondering if anybody has any experience using PhysicsEditor with Corona and getting specific shape id’s upon collision?
This is what I’m getting from PhysicsEditor:
function physicsData(scale)
local physics = { data =
{
["backboard"] = {
{
pe\_fixture\_id = "backboard", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535 },
shape = { -7, -132.5 , -59, -72.5 , -59, -214.5 , -7, -214.5 }
} ,
{
pe\_fixture\_id = "pole", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535 },
shape = { 104, 204.5 , 8, 210.5 , 57, 170.5 , 104, 184.5 }
}
}
}
-- Some other code...
end
and I initiate the object within my createScene function with this:
local backboardShape = display.newImageRect( "assets/images/backboard.png", 286, 445 )
physics.addBody( backboardShape, "static", physicsData:get("backboard") )
backboardShape.name = "backboard"
so when a collision event happens I could get the name variable of “backboard” with event.object1.name but is there any way to get the specific shape that’s stored in the pe_fixture_id variable in the above code, so I could differentiate a collision between “backboard” or “pole”?
Any help is greatly appreciated.
Thanks!
David [import]uid: 112953 topic_id: 22807 reply_id: 322807[/import]
