You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Area2Ds which extend beyond the bounds of the root viewport, eg. when using a canvas_items stretch mode, receive mouse input events even in the black bands letterboxing the game:
simplescreenrecorder-2023-07-29_13.40.59.mp4
Steps to reproduce
Set project stretch mode to either canvas_items or viewport
Have an Area2D whose CollisionShape extends beyond the bounds of the rendered region
Connect the Area2D's mouse_[entered|exited] signal to something
Wave the mouse around in the black areas outside the rendered game
I can confirm this issue also for the following situations:
for Control-nodes that are located outside of the stretched root-Viewport
a SubViewport of size (100,100) is within a SubViewportContainer of size (200,200) and contains a Control/Area2D, that lies right/below of the (100, 100) size.
I had a quick look and these aspects are directly affected by #67791, so I believe, that it would make sense to wait for that PR before diving into this issue.
In the meantime as a workaround for the Area2D.input_event-issue, you could check, if the mouse cursor is within the area of the Viewport.
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Godot v4.1.1.stable - Debian GNU/Linux trixie/sid trixie - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (nvidia) - Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (6 Threads)
Issue description
Area2D
s which extend beyond the bounds of the root viewport, eg. when using acanvas_items
stretch mode, receive mouse input events even in the black bands letterboxing the game:simplescreenrecorder-2023-07-29_13.40.59.mp4
Steps to reproduce
canvas_items
orviewport
Area2D
whoseCollisionShape
extends beyond the bounds of the rendered regionArea2D
'smouse_[entered|exited]
signal to somethingMinimal reproduction project
Project used for video demo above:
area2d-oob.zip
This only demos
mouse_[entered|exited]
, but I first encountered this with theArea2D.input_event
signal, where it received mouse clicks as well.The text was updated successfully, but these errors were encountered: