Jump to content

Create A Circle Image Map


tuantulpo
 Share

Recommended Posts

  • tuantulpo changed the title to Create A Circle Image Map
  • 1 month later...

I'm not sure about what you call a "Circle Image map", but you can create textures with the Phaser.GameObjects.Graphics class, export it as a textures with its generateTexture() method and then use this texture as your Sprite.

 

const graphics = new Phaser.GameObjects.Graphics(this)
graphics.lineStyle(2, 0x0000FF, 1.0)
graphics.strokeCircle(6, 6, 5)
graphics.generateTexture('blue-circle', 12, 12)

this.add.sprite(0, 0, 'blue-circle') // 'this' is your Phaser.Scene object

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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