Hi. i have trouble
When I import image to physics editor after succesfully do point to ITEM but i my ITEM in MAIN.LUA is still same with square collision.
When i publish ITEM from physics editor i have this code
– This file is for use with Corona® SDK
–
– This file is automatically generated with PhysicsEdtior (http://physicseditor.de). Do not edit
–
– Usage example:
– local scaleFactor = 1.0
– local physicsData = (require “shapedefs”).physicsData(scaleFactor)
– local shape = display.newImage(“objectname.png”)
– physics.addBody( shape, physicsData:get(“objectname”) )
–
– copy needed functions to local scope
local unpack = unpack
local pairs = pairs
local ipairs = ipairs
local M = {}
function M.physicsData(scale)
local physics = { data =
{
[“drewno01”] = {
{
pe_fixture_id = “DREWIENKO”, density = 2, friction = 0.5, bounce = 0.3,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 5.5, 29.5 , -25.5, 15.5 , -49.5, 0.5 , -15.5, -32.5 , 11.5, -38.5 , 42.5, -27.5 , 16.5, 19.5 , 10.5, 28.5 }
}
,
{
pe_fixture_id = “DREWIENKO”, density = 2, friction = 0.5, bounce = 0.3,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 42.5, -27.5 , 11.5, -38.5 , 30.5, -37.5 , 38.5, -33.5 }
}
,
{
pe_fixture_id = “DREWIENKO”, density = 2, friction = 0.5, bounce = 0.3,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 11.5, -38.5 , -15.5, -32.5 , -0.5, -38.5 }
}
,
{
pe_fixture_id = “DREWIENKO”, density = 2, friction = 0.5, bounce = 0.3,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -49.5, 0.5 , -47.5, -5.5 , -36.5, -17.5 , -15.5, -32.5 }
}
}
} }
– apply scale factor
local s = scale or 1.0
for bi,body in pairs(physics.data) do
for fi,fixture in ipairs(body) do
if(fixture.shape) then
for ci,coordinate in ipairs(fixture.shape) do
fixture.shape[ci] = s * coordinate
end
else
fixture.radius = s * fixture.radius
end
end
end
function physics:get(name)
return unpack(self.data[name])
end
function physics:getFixtureId(name, index)
return self.data[name][index].pe_fixture_id
end
return physics;
end
return M
I really dont know where this code paste in main.lua to works fine.