var customOption= {
density: 0.2,
restitution: 0.8,
render: {
sprite: {
texture: './images/bowl.png',
xScale: 1,
yScale: 1
}
}
};
var ball= {
density: 0.2,
restitution: 0.8,
render: {
sprite: {
texture: './images/football.png',
xScale: 1,
yScale: 1
}
}
};
var customShape = Vertices.fromPath('35 7 19 17 14 38 14 58 25 79 45 85 65 84 65 66 46 67 34 59 30 44 33 29 45 23 66 23 66 7 53 7');
var customBody = Bodies.fromVertices(80, 10, customShape, customOption);
var foot = Bodies.circle(380, 40, 50 / 2, ball);
customBody 没有显示任何纹理,但足球对象渲染良好。
请告诉我我在哪里做错了。