Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

rparrett
Copy link
Contributor

@rparrett rparrett commented Sep 23, 2022

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)

@Nilirad Nilirad added C-Examples An addition or correction to our examples A-Input Player input via keyboard, mouse, gamepad, and more labels Sep 23, 2022
Copy link
Contributor

@BorisBoutillier BorisBoutillier left a 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.

Comment on lines 22 to 27
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;
Copy link
Contributor

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;

Copy link
Contributor Author

@rparrett rparrett Sep 23, 2022

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.

image

Copy link
Contributor

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

@rparrett rparrett changed the title Add a gamepad demo/debug example Add a Gamepad Viewer tool to examples Sep 23, 2022
Copy link
Contributor

@IceSentry IceSentry left a 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.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 24, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a 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+

bors bot pushed a commit that referenced this pull request Sep 24, 2022
# 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)
@bors
Copy link
Contributor

bors bot commented Sep 24, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Sep 24, 2022
# 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)
@bors bors bot changed the title Add a Gamepad Viewer tool to examples [Merged by Bors] - Add a Gamepad Viewer tool to examples Sep 24, 2022
@bors bors bot closed this Sep 24, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 19, 2022
# 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)
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# 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)
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants