How to use an SVG image in Matter.js?
08:06 11 Dec 2020

What I'm trying to do: Use a Font Awesome SVG - sleigh - in matter.js.

I've tried this:

Matter.Bodies.fromVertices(500, 50 , Matter.Svg.pathToVertices("sleigh.svg"))

But got:

matter.js:4624 matter-js: Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.

matter.js:7554 Uncaught TypeError: Cannot read property 'numberOfItems' of undefined

What am I doing wrong?

(P. S: I'm pretty new to matter.js, so sorry if this is a silly question…)

javascript svg font-awesome matter.js