Jump to content

Graphics.generateTexture() not working properly?


lokeen
 Share

Recommended Posts

let grahpic = this.add.grahpics()
        .fillRoundedRect(0, 0, 300, 200, 10)
        .generateTexture('box', 300, 200)

this.add.image(100, 100, 'box')

I was trying to create modals using a new scene and phaser graphics to create a menu when I encountered a issue where generating the texture would cause the texture 'box' to get cut off at the bottom left corner. Increasing the width and height params in the generateTexture didn't help either. 

Was wondering if anyone encountered similar problems.

Link to comment
Share on other sites

  • 4 weeks later...

Where are you testing? Which browser, which Phaser version?

I've tried it with the dev version and it looks fine. Now you are drawing the rectangle with center on the position 100, 100. If you want to draw the top left corner at that position then change to this.add.image(100, 100, 'box').setOrigin(0)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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