[Merged by Bors] - Add a Gamepad Viewer tool to examples#6074
[Merged by Bors] - Add a Gamepad Viewer tool to examples#6074rparrett wants to merge 7 commits intobevyengine:mainfrom
Conversation
There was a problem hiding this comment.
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.
| 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.
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.
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.
Yeah, I'd prefer keeping the default bevy clear color and use colors similar to other examples
76fe3a5 to
285947e
Compare
IceSentry
left a comment
There was a problem hiding this comment.
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
alice-i-cecile
left a comment
There was a problem hiding this comment.
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)