我是 Corona 和 Lua 的新手。我有以下问题:
我有一个cake
具有这些物理参数的对象(并不重要):
["cake1"] = {
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -21, 62.5 , -36, 62.5 , -50, 55.5 , -58.5, 46 , -36, -38.5 , 57, -40.5 , 57.5, 34 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -7.5, -63 , -13, -61.5 , -12, -64.5 , -8, -64.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -12, -64.5 , -13, -61.5 , -17.5, -56 , -21, -52.5 , -18.5, -60 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -47, -37.5 , -58.5, 46 , -58.5, -33 , -53, -37.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -26, -52.5 , -21, -52.5 , -18.5, -52 , -9, -47.5 , -6.5, -41 , -36, -38.5 , -34.5, -46 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -36, -38.5 , -58.5, 46 , -47, -37.5 , -42, -39.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -6.5, -41 , -9, -47.5 , -6.5, -44 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 25, -40.5 , 7, -40.5 , 17, -42.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 48, -42.5 , 57, -40.5 , 25, -40.5 , 32, -42.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -18.5, -52 , -21, -52.5 , -17.5, -56 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 7, -40.5 , -36, -38.5 , -6.5, -41 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 25, -40.5 , -36, -38.5 , 7, -40.5 }
}
}
当我将它插入场景时,我得到以下结果:
cake
太大了,所以我用来cake1:scale(0.5,0.5)
改变他的大小。问题是物理没有自动改变以适用于它的新大小,结果是:
是否有任何简单的方法可以更改对象的大小并且物理特性会自动适应新的大小,或者我必须重写它们?