Code: Select all
this.load.xml("xml-pipe-bottom", "assets/svg/shape_pipe_b.svg");
< /code>
und erstellen Sie einen Körper und den SVG als Sprite: < /p>
const shapeBody = this.matter.add.fromSVG(
0,
0,
this.cache.xml.get(xmlKey)
)
shapeBody.ignoreGravity = true;
const shape = this.matter.add.sprite(400, 400, svgKey)
.setIgnoreGravity(true)
.setExistingBody(shapeBody)
Die SVG ist nur das SVG -SVG. Der Erzeuger ist immer der gleiche. class = "snippet-code-html Lang-html PrettyPrint-Override">
Code: Select all
id="rect1"
style="fill:#000000;stroke-width:0.264583"
d="M 50.000049,0 A 50,50 0 0 1 0,50.000049 h 50.000049 z"/>