Only fire top Area2D mouse events when something like 'physics_object_mouse_first_only' enabled #9707
DashTheDev
started this conversation in
2D
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As of 4.3-dev6, we have top-most physics object picking/sorting which was introduced in #75688. Mouse events were being excessively fired with this setting on and this was fixed in #89643. However, I haven't found the option to only fire mouse_entered and mouse_exited signals on Area2Ds depending on the top-most Area2D.
Essentially, when I have my mouse hovered over an Area2D (Area1) and another Area2D (Area2) appears above it, I want the mouse_exited signal to fire on Area1 and the mouse_entered signal to fire on Area2. And then when you move your mouse on and off the stacked Areas, it should only fire mouse_exited and mouse_entered signals on Area2 (the top-most area).
As it stands right now with the same sorting setting turned on, if you were to place Area2 ontop of Area1 whilst hovering over Area1. Area1 doesn't fire any signals and Area2 fires the mouse_entered signal. Similarly to the previous example, if you were then to move your mouse on and off the stacked Areas, mouse_exited and mouse_entered are fired on both Areas.
I have work arounds for this right now, but it would be good if we could enable something along the lines of 'physics_object_mouse_first_only' so we can track exactly which Area2D is hovered over based on top-most collision sorting and not just all of them.
Beta Was this translation helpful? Give feedback.
All reactions