Jump to content

Using Phaser.Graphics to create sprite sheets or an atlas


qa_foo
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

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