Last active
October 24, 2017 23:03
-
-
Save lonekorean/a38a7e873a77a2b46134141454e033d7 to your computer and use it in GitHub Desktop.
Matter.js create body from path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CUSTOM_PATH = '425.6 327 273.8 315.6...'; | |
function customShape(x, y) { | |
let vertices = Matter.Vertices.fromPath(CUSTOM_PATH); | |
return Matter.Bodies.fromVertices(x, y, vertices, { | |
// set options if you need them... | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment