Matter.js精灵大小

Bra*_*sen 4 javascript sprite matterjs

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

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

这是我到目前为止:

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

lia*_*bru 11

试试这个:

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

另请参阅文档.