-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control inside Viewport inside ViewportContainer ignores gui-event tree order and is in front #48401
Comments
Related to #48368. |
I think I figured out why this is happening, but I'm not sure if I will have time to fix it. See the following lines in if (!is_input_handled()) {
get_tree()->_call_input_pause(input_group, "_input", ev, this); //not a bug, must happen before GUI, order is _input -> gui input -> _unhandled input
}
if (!is_input_handled()) {
_gui_input_event(ev);
} The code in the first block leads to |
Duplicate of #39666 |
Godot version:
v3.3 stable
OS/device including version:
Windows 10
Issue description:
with a scene-structure like this:
![image](https://user-images.githubusercontent.com/24807557/116878479-b7a5eb80-ac1f-11eb-985c-618551355f23.png)
The TextureRect is drawn in the right order (behind the button), but the TextureRect (set to mouse_filter_stop) catches all the mouse-inputs.
![Viewport_Cointainer_Control](https://user-images.githubusercontent.com/24807557/116878445-a9f06600-ac1f-11eb-9846-6faf9a1f3fcd.gif)
Therefore i cant click on the Button where the TextureRect is being displayed in the ViewportContainer:
In my game i have a world-map which is inside of a viewportContainer where the buttons block mouse-inputs even though they are not visible (either behind another UI-Element or even outside the viewport).
![Viewport_Cointainer_Control_Game](https://user-images.githubusercontent.com/24807557/116879346-da84cf80-ac20-11eb-8f76-3faeb06cdaed.gif)
I have a complicated workaround for this in my project, but it still doesnt solve the basic problem of the button being in front.
The workaround checks if the mouse exits the viewport-container (as this control element is still properly handling the mouse-input) and switch the mouse_filter to Ignore for the buttons. But this doesnt work if the mouse is still inside of a button as it leaves the map:
I was expecting the texture-rect to have the same gui_input order as it is drawn (texture_rect is behind the button)
Steps to reproduce:
In the project the native behaviour is replicated. Run the project and see how the textureRect inside the viewport is actually soaks up the mouse-input as if it were in front.
Minimal reproduction project:
Viewportcontainer replication project.zip
The text was updated successfully, but these errors were encountered: