Travis Posted September 26, 2013 Share Posted September 26, 2013 Hi. I'm using phaser pixi framework, and I want to use custom spline interpolation to create amorphous shapes. However pixi only supports polygon, ellipses, and circles. Is there some sort of way I could add support for custom shapes outside of adding code to CanvasGraphics.js? Because I don't want to keep rewriting that code everytime I update my Phaser.js file. EDIT: The easiest way I see it is adding new data type PIXI.Graphics.SPLI = 4. Then adding my function drawSpline to the PIXI.Graphics prototype. Then add extra else if to the PIXI.CanvasGraphics with my algorithm. Thinking about it, I don't see how else that kind of thing will be done. My question still stands, but for now I'll just take the source and modify it. EDIT2: odd performance errors when filling. hm, this might take a long time to implement lol. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 26, 2013 Share Posted September 26, 2013 Have you tried use a custom renderable? https://github.com/GoodBoyDigital/pixi.js/blob/master/src/pixi/extras/CustomRenderable.js Quote Link to comment Share on other sites More sharing options...
Travis Posted September 26, 2013 Author Share Posted September 26, 2013 Could I make a mask using a display object? How would I do so? I'm trying to make a filled spline and use it to mask my sprite. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 27, 2013 Share Posted September 27, 2013 Masks can only be done via Graphics right now. 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.