How can I prevent mouse and touch inputs from interacting with world/entities underneath UI? #14043
Replies: 3 comments 3 replies
-
Please make some simple reproduction code, I placed two buttons at same place by position Absolute and this code:
gave output:
As you see |
Beta Was this translation helpful? Give feedback.
-
There's no notion of clearing events from one system for another. What I did a few time is add a full screen button that is under the rest of UI, If that button get the click, then it's for the game. The |
Beta Was this translation helpful? Give feedback.
-
@mockersf Could you explain in more detail on how you use a full screen button to conditionally prevent handling clicks in the world? Are you doing some variant of what @miketwenty1 suggests, that is
Or do you perform some other clever tricks using the full screen button? |
Beta Was this translation helpful? Give feedback.
-
I'm using NodeBundles/ButtonBundles etc..
If a user clicks on a button I'm also inadvertently capturing that click event for what is underneath the UI. I have a dynamic UI and a dynamic map underneath and would like to not have a hacky region where I ignore clicks.
I used to do:
And then
.chain()
systems where my UI systems would precede my other systems, but it seems for Bevy 13.2, this doesn't seem to do the trick for me.Is there an idiomatic way of accomplishing where if the UI is interacted with it clears any further mouse event?
Beta Was this translation helpful? Give feedback.
All reactions