puzzler Posted April 18, 2017 Share Posted April 18, 2017 Is there any support for Phaser for vector graphics artwork? I am unable to find any examples or documentation about this. Link to comment Share on other sites More sharing options...
mattstyles Posted April 18, 2017 Share Posted April 18, 2017 Phaser renders to canvas, which does not support SVG rendering, there may be a library out there that could convert an SVG specification into canvas draw calls though. Link to comment Share on other sites More sharing options...
puzzler Posted April 18, 2017 Author Share Posted April 18, 2017 Thanks. Assuming I had such a tool, does Phaser have a corresponding API to do canvas drawing instructions that draw into something that participates in the scene graph, and perhaps cache it as a bitmap? (My frame of reference is that I'm coming from easelJS which allows you to do vector graphics drawings on top of any sprite, or create a "shape" object which has no sprite associated with it, but is simply a surface for drawing instructions). Link to comment Share on other sites More sharing options...
mattstyles Posted April 18, 2017 Share Posted April 18, 2017 https://phaser.io/examples/v2/display/graphics exposes the canvas drawing operations (not sure how the apis differ, if at all). I don't think it will automatically cache it all but Pixi (used by Phaser) exposes a render to texture method which would do what you want I think. Link to comment Share on other sites More sharing options...
puzzler Posted April 18, 2017 Author Share Posted April 18, 2017 Perfect. Is it easy to call an arbitrary function in Pixi's API from Phaser? Link to comment Share on other sites More sharing options...
mattstyles Posted April 18, 2017 Share Posted April 18, 2017 Not sure but if I was to hedge my bets I'd say yes. Link to comment Share on other sites More sharing options...
Recommended Posts