0 votes

I'd like to get all the input events from a Control node, and pass them to another Node.

I'd like to avoid the X Y Problem (http://xyproblem.info), so here's more specifically what I want:

A grid where each square is clickable, but also have the entire map able to be panned around. In addition, a GUI above this which intercepts clicks, but does not disallow dragging of the aforementioned grid while the cursor is above it (the GUI).

My attempted solution:
Put a Control node above the grid, which resizes with the grid. Grab all the events and pass them to the grid, but also "past" the grid (hence "multiplex" in the title), so the camera script can do panning (via unhandledevent() )

Here is my current project: https://github.com/voxelv/azr

in zip: https://github.com/voxelv/azr/archive/master.zip

asked 6 days ago in Engine by voxelv (12 points)
edited 3 days ago by voxelv

1 Answer

0 votes

I presume that you use Control nodes to consist screen.
then, try to set Mouse > Filter to Pass instead of Stop

answered 6 days ago by volzhs (7,409 points)

What do you mean by "consist screen"?

I've tried "Pass", but it doesn't seem to have any effect different from "Stop".

can you share a sample project, or show scene tree?

Here is my current project: https://github.com/voxelv/azr

in zip: https://github.com/voxelv/azr/archive/master.zip

to see my problem, try zooming with the mouse wheel while over the grid of white boxes. Also, the area can be panned with Middle Mouse dragging, but that also doesn't work while over the grid of white boxes. Also, the big "TEST BUTTON IN GAME AREA" button does the same thing.

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.