Matter.js offset body

http://labs.phaser.io/view.html?src=src\physics\matterjs\offset%20body.js
hello,
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?

triangle
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