Replies: 1 comment
-
cc @YeldhamDev Personally, I would make editor locking/grouping affect the project as well (and make
We have |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
I have several controls that cover the whole screen in my game:
This prevents me from clicking on anything else using the new Godot 4.4 embedded game window 2D Selection mode: it just selects one of these two "huge" control nodes, despite them being invisible.
I need a way to disable selection on these huge control nodes so I can select the nodes behind.
Workaround
Currently I'm manually hiding the DebugDrawDefaultCanvas, but the trick only works that far when I don't need to see it. Then I must also hide the HUD, which may or may not be desirable... I cannot just disable selection without hiding said Control nodes.
Solutions
We can copy the solutions used in other contexts.
A. Node lock
In the editor Scene tree, Godot allows the user to lock a node (keypad icon). This prevents accidentally selecting any node or moving it when clicking on the Scene view. I always lock invisible container nodes such as huge control nodes placed just below CanvasLayer covering the whole screen, or even smaller controls that are empty and only serve as parent to place actual UI elements.
The embedded game window could simply honor the lock status of nodes in the Scene tree.
Advantages:
Issues:
B. Mouse debug selection filter property
At runtime, Godot checks the Mouse > Filter (
mouse_filter
) property of a Control node to decide whether a click should go through or not.We could add an equivalent property Mouse > Debug selection filter (
mouse_debug_selection_filter
ordebug_mouse_selection_filter
oreditor_mouse_debug_selection_filter
if Godot devs usedebug
oreditor
prefixes for special properties) that does the same, but is checked only by the embedded game window if 2D/Control selection modeUnlike
mouse_filter
there is no need to have 3 values Stop, Pass (Propagate Up) and Ignore, just Stop and Ignore will be enough. So it could be a boolean flag / checkbox instead of an enum. In this case it could be named e.g.ignore_embedded_game_window_selection
.Advantages:
control_node.ignore_embedded_game_window_selection = true
after creating the nodeIssues:
C. Distinguish 2D from Control Selection mode
We could split the current 2D/Control selection mode (shown by a circle half blue, half green) into two different selection modes
to
and
Advantages:
Issues:
D. Option to automatically ignore invisible Controls
That would be a nice option to have in any mode, in fact: editor, runtime, embedded game window
However Godot needs to be able to "understand" what an invisible Control is (does a TextureRect with a transparent color, or a sprite with transparent modulate qualifies, or only a truly empty Control that only acts as a Parent / Container?).
Beta Was this translation helpful? Give feedback.
All reactions