+1 vote

I am trying to create a side menu that pops up when you hover over the side button (see images below). This was working fine using the "mouseenter" and "mouseexit" signals. However, now I have added buttons into the side menu, whenever the mouse hovers over a button it calls the "mouseexit" signal and closes the menu screen. I tried adding code that when i entered the button with the mouse it would set a boolean value of hovering = true, and added this boolean into my panel "mouseexit" code to say that only close menu if button hovering == false. However, this also doesn't appear to work as it doesn't register the mouse being in the button until I move to mouse, at which point it registers the "mouse_exit" signal on the panel first.

image of side screen closed
https://ibb.co/mrHgUv

image of side screen open
https://ibb.co/d95Dba

in Engine by (289 points)

1 Answer

0 votes

By default, buttons stop the mouse events from propagating to their parents. You can change this by setting the Mouse filter to "pass" instead of stop in the Inspector for your buttons. That way both the button and its parent will receive the mouse events :)
If you'd set the filter to "ignore", only the parent would receive the events and the button wouldn't work anymore.

by (74 points)

Hi thanks for this, one problem is I can't seem to find the mouse filter option anywhere. Where can I find it in the editor?

So i unchecked the stop mouse option in the editor for my buttons, but this didn't appear to change anything

Ah, yes, apparently that's something they've added in 3.0...
I guess you should set both the stop mouse and ignore mouse options to false/unchecked. but I'm not 100% sure that that will work

Ah thanks, not essential right now so will just correct the issue in the stable release of GODOT 3.0

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.