federicovezzoli Posted March 20, 2019 Share Posted March 20, 2019 Hi guys, I'm trying to draw a polygon/line from the coordinates of an svg path. I thought to use the path2d method, as it works correctly on native canvas, but I cannot make it work with pixi and couldn't fine anyone talking about it around. Something like this, but it's not working: let trackPath = new Path2D("M10 10 h 80 v 80 h -80 Z") graphic = new PIXI.Graphics() graphic.drawPolygon(trackPath) app.stage.addChild(graphic) Anyone? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 20, 2019 Share Posted March 20, 2019 Path2D is awesome but pixi doesnt support it, and I have long-term plan of adding more Vector-related plugins to pixi. Maybe you can salvage something from https://github.com/bigtimebuddy/pixi-svg ? I mean that you look at their source and see if there's actuallly a parser for strings or something like that to create your own PIXI Path that works with Graphics? Quote Link to comment Share on other sites More sharing options...
federicovezzoli Posted March 20, 2019 Author Share Posted March 20, 2019 Thanks I'll give it a go. I'll post an eventual solution here. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.