Jump to content

Easy way to add support for custom render shapes?


Travis
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...