How to stop mouse input events going through a panel node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By eod

Hello,

Current game node structure:

Main Scene:
MapView (Node2D)
. Camera2D
. Navigation2D
… TileMap
. PopupLayer (CanvasLayer)
… CenterContainer
… EscapeMenu_PP (PopupPanel, Layer=2, instanced as a scene)

Scene:
EscapeMenu_PP
. Panel
… VboxContainer
… Save_BTN (Button)
… Load_BTN (Button)

So when I hit the ESC key, the EscapeMenu_PP shows. It’s about 300 pixels wide and 500 pixels tall and shows up above the TileMap, and doesn’t cover the entire TileMap (game screen). However mouse inputs still “go-through” (pass?) this panel node and interact with the Camera2D.gd script.

For instance, in the Camera2D.gd script, I check for things like:
func _input(event):
. if event is InputEventMouseButton:
… # middle click detected and do action…
… # scroll wheel detected and do action… (e.g. zooming)
. if event is InputEventMouseMotion:
… # used to implement “dragging” map…

Each of the above input actions still happen when I’m clicking/interacting with the EscapeMenu_PP panel. For instance, with the mouse in the panel, if I scroll the mouse wheel the zoom functionality on the map still occurs

Here is the breakdown of mouse filters in the inspector (referenced from above node structure):

Main Scene:
MapView (Node2D)
… snip …
. PopupLayer
… CenterContainer (filter=Stop)
… EscapeMenu_PP (filter=Stop)

Scene:
EscapeMenu_PP (filter=Stop)
. Panel (filter=Stop)

I reviewed this, but didn’t quite make sense of it, or if it applies:

My main question is how to stop (mouse) input events of going through the popup panel?

:bust_in_silhouette: Reply From: eod

Took a while but figured it out by disabling the _input of the Camera2D.gd when first popping up the panel.

$“Camera2D”.set_process_input(false)

And then I simply enable it when the panel gets closed.