Matter.js 精灵大小

Matter.js Sprite Size

我正在使用 matter.js 进行物理模拟。

我的问题是,是否可以更改精灵大小?或者仅使用 matter.js 是不可能的?

这是我目前拥有的:

Bodies.circle(x, y, 46, {
  render: {
    sprite: {
      texture: 'images/stone.png'
      //Is there a 'width:' or 'height' property?  
    }
  }
});

试试这个:

Bodies.circle(x, y, 46, {
  render: {
    sprite: {
      texture: 'images/stone.png',
      xScale: 2,
      yScale: 2
    }
  }
});

另见 docs