liabru / matter-js

a 2D rigid body physics engine for the web ▲● ■
MIT License
16.86k stars 1.97k forks source link

How to change/update sprites textures in matterjs on clicking other object? #433

Open TimuJiang opened 7 years ago

TimuJiang commented 7 years ago

How to change/update sprites textures in matterjs on clicking other object?

liabru commented 7 years ago

Did you try changing body.render.sprite.texture?

TimuJiang commented 7 years ago

yes

lukebrandonfarrell commented 5 years ago

If you are using react make sure to use require("...")