qa_foo Posted September 1, 2016 Share Posted September 1, 2016 Hi all, I'm just wondering if there's a way to create a sprite sheet, or ideally an atlas using Phaser.Graphics? As far as I understand it, Phaser.Graphics is vector based and it would need to be rendered out to a texture. I tried using generateTexture() (which returns a PIXI.RenderTexture), with the game.cache.addSpriteSheet function in 'create' and it doesn't seem to work or give any error in the console. I guess I could use the BitmapData class to draw on and use the canvas but I was hoping to use Phaser.Graphics for the API and so when generating textures it is scalable etc. Maybe there's a better way of doing this? Thanks for any help. Link to comment Share on other sites More sharing options...
rich Posted September 1, 2016 Share Posted September 1, 2016 Like this: http://phaser.io/examples/v2/display/spritesheet-from-graphics Link to comment Share on other sites More sharing options...
qa_foo Posted September 1, 2016 Author Share Posted September 1, 2016 12 hours ago, rich said: Like this: http://phaser.io/examples/v2/display/spritesheet-from-graphics Ahh perfect, sorry, I completely missed that example. Link to comment Share on other sites More sharing options...
symof Posted September 3, 2016 Share Posted September 3, 2016 @richThat example can only be found via direct link. It does not show in a search or in the display category. http://phaser.io/examples/v2/search?search=spritesheet http://phaser.io/examples/v2/category/display Link to comment Share on other sites More sharing options...
rich Posted September 4, 2016 Share Posted September 4, 2016 There are lots of bits of code in the Examples Repo that aren't displayed on the site. Which is why it's well worth checking out the repo and digging around, you never know what you may turn up. The example above was coded last week in response to another forum question asking the same thing. Link to comment Share on other sites More sharing options...
Recommended Posts