How do I restart the scene? My code doesn’t work
buttonR = this.add.group()
function createButton() {
buttonRestart = buttonR.create(5, 5, 'button')
}
buttonRestart.on('pointerup', function() {
this.scene.restart()
})
How do I restart the scene? My code doesn’t work
buttonR = this.add.group()
function createButton() {
buttonRestart = buttonR.create(5, 5, 'button')
}
buttonRestart.on('pointerup', function() {
this.scene.restart()
})
It’s missing setInteractive()
. And the pointerup handler needs a context
argument. See the examples.