godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.56k stars 21.27k forks source link

Objects are clickable when the splash screen is visible #21804

Open sami8github opened 6 years ago

sami8github commented 6 years ago

Godot version: v3.1.alpha.calinou.f50dd68

OS/device including version: windows 10 x64

Issue description: Items (buttons & objects) are clickable and interact-able when the splash screen is visible. it looks like the scene is active but its hidden with the splash image. there is a turnaround for this which is: pause scene on _ready method and unpause after one second.

Steps to produce: add button to scene >> add function to the button (when click change color/text/...) >>run the scene >>when the splash screen shows click on the place where the button is located >> the button will be clicked.

akien-mga commented 6 years ago

I could reproduce it on Linux.

The issue is not that objects are clickable when the splash screen is visible per se, as when the splash screen is shown the objects are not even instanced yet. But the Godot window registers input events while the splash screen is shown, and then sends them to the main scene once initialized.

So if you connect a button's button_pressed signal to a method that prints something, you will see that when clicking its location during the splash screen, nothing happens, but when the scene finally loads, the press and print occur.

It might be possible to disable event polling until the main scene is initialized.

sami8github commented 5 years ago

any news about this ?

KoBeWi commented 4 years ago

Still valid in 9e34ba4

KoBeWi commented 1 month ago

Still valid in 4.4 Although it seems the buttons are not "clickable", but the window buffers input events and can't process them until it loads. Thus once the project finishes loading, all buffered events are fired at once, causing buttons to be pressed etc.