-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Add a Gamepad Viewer tool to examples #6074
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really good tool/example to trouble check gamepads, and also see some more advanced code interacting with the GamePad, even if 'boring'.
But I think it would better fit as tools/gamepad_viewer.rs
rather than a input/gamepad_demo.rs
I have proposed a different set of colors, that I found more appealing, but that is really subjective.
examples/input/gamepad_demo.rs
Outdated
const NORMAL_BUTTON_COLOR: Color = Color::rgb(0.2, 0.2, 0.2); | ||
const ACTIVE_BUTTON_COLOR: Color = Color::PURPLE; | ||
const LIVE_COLOR: Color = Color::rgb(0.4, 0.4, 0.4); | ||
const DEAD_COLOR: Color = Color::rgb(0.3, 0.3, 0.3); | ||
const EXTENT_COLOR: Color = Color::rgb(0.3, 0.3, 0.3); | ||
const TEXT_COLOR: Color = Color::WHITE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried a simpler set of color (associated with a ClearColor(Color::BLACK)
const NORMAL_BUTTON_COLOR: Color = Color::GRAY;
const ACTIVE_BUTTON_COLOR: Color = Color::DARK_GREEN;
const LIVE_COLOR: Color = Color::BLACK;
const DEAD_COLOR: Color = Color::MAROON;
const EXTENT_COLOR: Color = Color::MAROON;
const TEXT_COLOR: Color = Color::WHITE;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to alternate color schemes. I feel like it would be best to match existing examples, especially with the bevy examples page on the website though.
I'm curious to hear other opinions about this, but the proposed set looks a little out of place on the website to me, and the contrast between full-white text and full-black background seems a bit intense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd prefer keeping the default bevy clear color and use colors similar to other examples
76fe3a5
to
285947e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could update to the new spawn
that replaces spawn_bundle
but other than that, code looks good. It's a lot of code, but the examples in tools/
are intended to be a bit more advanced, so I think that's good.
285947e
to
f0085a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work; we can refine this further as we go.
bors r+
# Objective Give folks an easy way to test their gamepad with bevy. ~~This is a lot of very boring code for an example. Maybe it belongs in the "tools" directory?~~ ## Solution https://user-images.githubusercontent.com/200550/191884342-ace213c0-b423-449a-9295-530cbceaa19e.mp4 ## Notes This has brought to light (to me, anyway) some fairly major issues with gamepads on the web. See: [WASM mappings (gilrs issue 107)](https://gitlab.com/gilrs-project/gilrs/-/issues/107) [Inaccurate value for trigger button of Xbox gamepad with WASM (gilrs issue 121)](https://gitlab.com/gilrs-project/gilrs/-/issues/121)
Build failed (retrying...): |
# Objective Give folks an easy way to test their gamepad with bevy. ~~This is a lot of very boring code for an example. Maybe it belongs in the "tools" directory?~~ ## Solution https://user-images.githubusercontent.com/200550/191884342-ace213c0-b423-449a-9295-530cbceaa19e.mp4 ## Notes This has brought to light (to me, anyway) some fairly major issues with gamepads on the web. See: [WASM mappings (gilrs issue 107)](https://gitlab.com/gilrs-project/gilrs/-/issues/107) [Inaccurate value for trigger button of Xbox gamepad with WASM (gilrs issue 121)](https://gitlab.com/gilrs-project/gilrs/-/issues/121)
Pull request successfully merged into main. Build succeeded: |
# Objective Give folks an easy way to test their gamepad with bevy. ~~This is a lot of very boring code for an example. Maybe it belongs in the "tools" directory?~~ ## Solution https://user-images.githubusercontent.com/200550/191884342-ace213c0-b423-449a-9295-530cbceaa19e.mp4 ## Notes This has brought to light (to me, anyway) some fairly major issues with gamepads on the web. See: [WASM mappings (gilrs issue 107)](https://gitlab.com/gilrs-project/gilrs/-/issues/107) [Inaccurate value for trigger button of Xbox gamepad with WASM (gilrs issue 121)](https://gitlab.com/gilrs-project/gilrs/-/issues/121)
# Objective Give folks an easy way to test their gamepad with bevy. ~~This is a lot of very boring code for an example. Maybe it belongs in the "tools" directory?~~ ## Solution https://user-images.githubusercontent.com/200550/191884342-ace213c0-b423-449a-9295-530cbceaa19e.mp4 ## Notes This has brought to light (to me, anyway) some fairly major issues with gamepads on the web. See: [WASM mappings (gilrs issue 107)](https://gitlab.com/gilrs-project/gilrs/-/issues/107) [Inaccurate value for trigger button of Xbox gamepad with WASM (gilrs issue 121)](https://gitlab.com/gilrs-project/gilrs/-/issues/121)
# Objective Give folks an easy way to test their gamepad with bevy. ~~This is a lot of very boring code for an example. Maybe it belongs in the "tools" directory?~~ ## Solution https://user-images.githubusercontent.com/200550/191884342-ace213c0-b423-449a-9295-530cbceaa19e.mp4 ## Notes This has brought to light (to me, anyway) some fairly major issues with gamepads on the web. See: [WASM mappings (gilrs issue 107)](https://gitlab.com/gilrs-project/gilrs/-/issues/107) [Inaccurate value for trigger button of Xbox gamepad with WASM (gilrs issue 121)](https://gitlab.com/gilrs-project/gilrs/-/issues/121)
Objective
Give folks an easy way to test their gamepad with bevy.
This is a lot of very boring code for an example. Maybe it belongs in the "tools" directory?Solution
gamepad_demo.mp4
Notes
This has brought to light (to me, anyway) some fairly major issues with gamepads on the web. See:
WASM mappings (gilrs issue 107)
Inaccurate value for trigger button of Xbox gamepad with WASM (gilrs issue 121)