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

in Engine by (15 points)
edited by

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

by (9,782 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.