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:
EscapeMenuPP
. Panel
.. VboxContainer
... SaveBTN (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:
https://github.com/godotengine/godot/issues/10511
My main question is how to stop (mouse) input events of going through the popup panel?