Monday, May 20, 2024
56
rated 0 times [  63] [ 7]  / answers: 1 / hits: 15979  / 6 Years ago, fri, june 22, 2018, 12:00:00

Is there any method to pause a running game and resume back (using a button) in Phaser-3 framework? The one given for Phaser-2 is not working.


More From » phaser-framework

 Answers
18

In phaser3 you can have several scenes running in parallel. So you can create a new scene with the resume button and pause the current scene. If you have 2 scenes A e B you can do:



# In scene A
this.scene.launch('sceneB')
this.scene.pause();

# Then in sceneB, you can return to sceneA:
button.on('pointerdown', function() {
this.scene.resume('sceneA');
this.scene.stop();
})

[#54141] Tuesday, June 19, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
longd

Total Points: 616
Total Questions: 110
Total Answers: 101

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;