-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
Container doesn't recognise mouse_enter #6873
Comments
I guess that container is almost hidden under menu item and gets mouse events only in tiny parts, which are not hidden by child control. In my opinion, everything is working alright. |
@Cobradabest Can you confirm that what @mateka suggests works/doesn't work so that we can close the issue? PS. I agree that it probably gets hidden by child nodes that have Ignore Mouse off. |
@Cobradabest Pretty ping 😄 |
Okay I just tested this out. Going to agree with @mateka here. Basically this is not isolated towards For example, if you have a hierarchy like this: And set a Is this intended or normal behavior? I think it's just how Godot works. However, ideally, I think if the children have a parent that has a However again, this also allows for rich UI development. Because you can set the focus/ignore_mouse property and have tons of children doing a bunch of crazy shit without their own children affecting it (if that child has a Double edge sword |
However, now that I think of it I'm wrong. Conrol -> Panel -> Button Set a But, what if you want to have Maybe we should allow the children of a |
The way this is done in Web APIs (JavaScript et al) is via event "bubbling" - i.e., in the default case, events triggered on child elements/controls will trigger handlers, if present, on both the control as well as all parent nodes. (Most events behave this way, but not all - for example, the In some cases, a more specific handler (say, on With bubbling as described above, I'm not sure what |
First of all thank you for your report and sorry for the delay. We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to. We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors. Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed. Thanks in advance. Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it. |
Closing as old. If the original issue is still valid in the current master branch / latest stable release, please comment here or open a new issue. |
@akien-mga I can confirm this behavior and I think we should talk about this again, I would like to explain my use case and why event bubbling would solve this properly and simple: I have the following hierarchy, anchored center right:
The CanvasLayer is offsetted by VBoxContainer.RectSize.x - 20, so a little bit is visible. When the VBoxContainer gets OnMouseEntered(), I animate the Canvaslayer to see the full buttons, when the VBoxContainer gets mouseleft(), the menu should animate back to the right initial state, done via tween. So I have a neat sliding menu on hover. As The event is not bubbled to the parent I would need to manually wire up the events from each button (or child control!) and emit a signal manually on the parent, so that the canvas layer can animate properly. It would be really helpful to at least activate kind of signal bubbling manually with a flag. |
@trommlbomml See various proposals on this subject: godotengine/godot-proposals#788, godotengine/godot-proposals#1322 |
Thx, then this issue can stay closed. |
Operating system or device - Godot version:
Windows 10, Godot v2.1 stable
Issue description (what happened, and what was expected):
When using mouse_enter with a container, the container only recognises the mouse at a very specific and small spot
Steps to reproduce:
Create a container item and create a script containing the mouse_enter flag
Link to minimal example project (optional but very welcome):
https://www.dropbox.com/s/vvfwhlu2xvyo0mu/Test.zip?dl=0
The text was updated successfully, but these errors were encountered: