Matter.js offset body\physics\matterjs\offset%20body.js
var triangle = this.matter.add.sprite(400, 100, ‘triangle’, null, {
shape: { type: ‘fromVerts’, verts: shapes.triangle },
render: { sprite: { xOffset: 0.30, yOffset: 0.15 } }
anyone knows why ‘xOffset’ is 0.3 and ‘yOffset’ is 0.15?

this is the triangle.png

I messed with the numbers, and keeping them as decimals is probably best. I think the numbers should be a little bigger though, because it’s hard to tell what the offset actually does.

I think the offset should be a integer in px.:grimacing:

1 Like