Problem with mouse_enter and mouse_exit signals when button overlying texture frame.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stubbsy345
:warning: Old Version Published before Godot 3 was released.

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 “mouse_enter” and “mouse_exit” signals. However, now I have added buttons into the side menu, whenever the mouse hovers over a button it calls the “mouse_exit” 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 “mouse_exit” 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

image of side screen open

:bust_in_silhouette: Reply From: Robin Arys

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 :slight_smile:
If you’d set the filter to “ignore”, only the parent would receive the events and the button wouldn’t work anymore.

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?

stubbsy345 | 2017-08-17 20:55

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

stubbsy345 | 2017-08-17 21:17

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

Robin Arys | 2017-08-19 21:31

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

stubbsy345 | 2017-08-22 11:55