Popup Scenes

I’m wondering how I would handle a popup. My idea was to pause the current scene and have another scene popup then when a button is handled that scene is destroyed and the current scene is resumed.

https://labs.phaser.io/edit.html?src=src\scenes\drag%20scenes%20demo.js

Similar to this. But I want to be able to destroy/remove. I’ve tried setting a onClick to the scene just to test and I havent found a way to remove the zone. When I called this.parent.destory() in a Scene (for example Juggler) it tells me that it doesnt have the function destroy.

I’m wondering if there is another way to go about having a pop-up of sorts or should I avoid having more than one scene all together? Would appreciate any help or advice.

You could launch (run concurrently) another scene, but it might be overkill, depending on the complexity/functionality of the pop up content. It would allow you though to pause/sleep the original scene.

If you want to understand scenes more, I’d recommend reading some of the older dev logs that explain scene structure and how to manage multiple scenes.

1 Like