Hello,
I´m having difficult understanding what I suppose should be a simple task.
I have a clickable map so that when i click over objects on the map I can select them, but of course I dont want the player to be able to click on the map THROUGH the GUI.
So I declared a mouse_on_map
boolean variable to hold information about the position of the mouse, and linked it to GUI panels with mouse_entered()
and mouse_exited()
signals.
However it seems like that every button inside the monitored areas automatically trigger the mouse_exited()
signal, setting mouse_on_map=true
and tricking the game to think that the mouse is on the map and allowing the pressing of the button and selecting the map at the same time.
I know this thing should be managed with the mouse filters, but any combination of stop/pass/ignore seems not to work.
Can you explain the right combination of mouse filter of the parents and children nodes?
PS: is there a better way to mask the map and prevent it from being pressed rather than monitoring the mouse position? Something that block the mouse click to the first element it encounter?