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
I expected to start my application with Interaction::None.
What actually happened
Normal
Dec 08 21:09:46.756 WARN wgpu_core::device: Failed to parse shader SPIR-V code: UnsupportedBuiltIn(4)
Dec 08 21:09:46.756 WARN wgpu_core::device: Shader module will not be validated
Hover
Additional information
I am not sure if the WARN messages are relevant, though I found it odd that they show up between the change in state.
If setup is changed to add a second button, Interaction::Hovered never happens.
If the mouse is within the bounds of the window, Interaction::Hovered never happens.
If the mouse is within the bounds of the button, Interaction::Hovered occurs as expected.
The text was updated successfully, but these errors were encountered:
Moxinilian
added
C-Bug
An unexpected or incorrect behavior
A-UI
Graphical user interfaces, styles, layouts, and widgets
labels
Dec 9, 2020
the issue is that before you move your mouse, it uses the default value for a position which is (0, 0) so over your button in the corner... it's the default value of this field. This should be fixed, maybe by using an option to ignore mouse interaction before the mouse has been moved for the first time.
for your issue with two buttons, as you are using a single resource to keep the state of all your buttons, you can only see the state of one button (the last added)
if you change your system like this:
fninteraction(mutoutput:ResMut<Output>,i_query:Query<&Interaction,Changed<Interaction>>){for a in i_query.iter(){eprintln!("{:?}", a);match*a {Interaction::Clicked => output.msg = "Clicked".to_string(),Interaction::Hovered => output.msg = "Hover".to_string(),Interaction::None => output.msg = "Normal".to_string(),}}}
you should see all interactions. I added a filter Changed<Interaction> to the query to not be flooded every frame
Thank you for the input. I'm still trying to figure out some of the Query stuff.
As for the position, it would be better if the position could be determined prior to events. Otherwise, you could end up with the reverse situation of Hovered not triggering when it should. While this is such a minor issue, it would prevent odd behavior that makes UI feel a little clunky.
Bevy version
bevy = { git = "https://github.com/bevyengine/bevy", version = "0.3.0" }
Operating system & version
Windows 10
What you did
What you expected to happen
I expected to start my application with
Interaction::None
.What actually happened
Additional information
Interaction::Hovered
never happens.Interaction::Hovered
never happens.Interaction::Hovered
occurs as expected.The text was updated successfully, but these errors were encountered: