Skip to content
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

Drag Drop on TextureButton does not pass on to parent container #37470

Open
wytzen opened this issue Mar 31, 2020 · 4 comments
Open

Drag Drop on TextureButton does not pass on to parent container #37470

wytzen opened this issue Mar 31, 2020 · 4 comments

Comments

@wytzen
Copy link

wytzen commented Mar 31, 2020

Godot version:
3.2.1

OS/device including version:
Win 10

Issue description:
Drag and drop events are not passed from a TextureBbutton to a parent container

Minimal reproduction project:
DragDropExample.zip

In the example i provided there are three gui's that i have made with slightly different scripts and or nodes. The basic idea is that you can drag an image from the left to the gui on the right and then it will replace the icon in the center.

The top one is the one i would expect to be working, but it does not. In this situation the can_drop is attached to the container of the gui. It would therefore expect it to be droppable on the entire surface, but it is not droppable on the texturebuttons inside the container.

The middle example is my current compromise. In this situation the can_drop is attached to the central textureButton. So it is atleast possible to drag and drop on a texturebutton.

The third example has again the can_drop attached to the container, but now the central icon has been replaced with a texturerect, This case it is possible to drop on the rect and the surrounding areas, but still not on the little buttons.

This seems to me inconsistent and for me its also a big inconvenience as i would like to keep all of the nodes as TextureButtons.

@Calinou
Copy link
Member

Calinou commented Apr 5, 2020

Related to #28522.

@adabru
Copy link

adabru commented Jul 9, 2020

Hi @wytzen, you have to change the mouse_filter property of your TextureButton and CenterContainer from 'Stop' to 'Pass' in the inspector. The HBoxContainer and TextureRect have 'Pass' set by default so that they don't make problems. The reasoning is that InpuEventMouse events (Button+Motion) don't propagate to the parent container if a child stops its propagation.

Setting the mouse_filter to 'Pass' should solve your issue. Considering the mouse_filter property, I'd say this is expected behaviour.

@wytzen
Copy link
Author

wytzen commented Jul 15, 2020

I will try that. Thank you very much.

@Calinou
Copy link
Member

Calinou commented Jul 15, 2020

See also godotengine/godot-proposals#788.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants