How to block input event when loading new scene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lukas
:warning: Old Version Published before Godot 3 was released.

Suppose we have a button in scene A. When we press this button, scene A is freed and scene B is loaded. Further suppose that scene B has a button in the same position as scene A. When pressing button in scene A multiple times, first click frees scene A and loads scene B. Remaining clicks are processed just after the scene B is loaded. That means that the button in scene B is pressed.

How to prevent this?
I know that after the first click I can show up panel (e.g. with label “loading…”) that will stop all the events. But is there another way to do this? Way without placing new node to scene. Ideally is there a project or button setting that can prevent this?

:bust_in_silhouette: Reply From: Nuno Donato

How about setting a simple timer in scene B, say 1 second, and only after that you start processing inputs? That way it gives time for the user to understand the scene changed.

Thank for the tip! I hope for some option “turn off event detection during loading new scene” :).

lukas | 2016-03-23 13:26

if its on its because the scene is already loaded, it just might not be evident to the player

Nuno Donato | 2016-03-23 13:27

OK, are you sure? When I start loading a new scene, the old scene remains “frozen” on the screen (in this time user can click the button multiple times) and after a while (it depends on complexity of the new scene) new scene appears on the screen.
So you mean that there is a delay between the time when new scene is loaded and the time when the new scene is rendered on the screen?

lukas | 2016-03-23 13:44