Jump to content

How to switch out texture in Phaser 3


ccerqadfe
 Share

Recommended Posts

How do you switch out texture in an image object.

I have tried setTexture(),  but images go top of other. I like to have one shown if the image is clicked.

this.toggle.on('pointerdown', () => {
    if (this.switch === true) {
        this.switch = false
        this.toggle.setTexture("pause") 
    } else {
        this.switch = true
        this.toggle.setTexture('play') 
                
    }
})

Thank You.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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