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

Add gamepad_stick_input example #6052

Closed
wants to merge 13 commits into from

Conversation

targrub
Copy link
Contributor

@targrub targrub commented Sep 21, 2022

Objective

(from #3721 writeup by mfdorst)
In pursuit of #3691 I felt that it would be handy to have a way to visualize the gamepad stick input.

Solution

Add an example that shows gamepad stick input.

Rebase of #3721
See that for all comments.

@targrub targrub changed the title Gamepad input example Add gamepad_stick_input example Sep 21, 2022
@alice-i-cecile alice-i-cecile added C-Examples An addition or correction to our examples A-Input Player input via keyboard, mouse, gamepad, and more C-Testing A change that impacts how we test Bevy or how users test their apps labels Sep 21, 2022
@targrub
Copy link
Contributor Author

targrub commented Sep 21, 2022

I'm hoping someone will review this with an eye to recommended Bevy practices. For example, the way ClearColor is used I believe may be outdated.

@rparrett
Copy link
Contributor

rparrett commented Sep 21, 2022

Moving some feedback from the other PR here:

I would prefer that we use the default window size and rework this so that the zone squares are displayed in the middle of the screen. If we were to put this example as it is now onto https://bevyengine.org/examples/, it would up very large size because it maintains the square aspect ratio.

There's no issue with the way ClearColor is being used here.

@targrub
Copy link
Contributor Author

targrub commented Sep 22, 2022

I would prefer that we use the default window size and rework this so that the zone squares are displayed in the middle of the screen. If we were to put this example as it is now onto https://bevyengine.org/examples/, it would up very large size because it maintains the square aspect ratio.

Since the bounds are -1.0 to 1.0 for both dimensions on the gamepad stick, I feel a square aspect ratio is most appropriate. I'll set the window to a square size of the minimum dimension, keeping within the window's WindowConstraints.

There's no issue with the way ClearColor is being used here.

Thanks.

@targrub targrub marked this pull request as ready for review September 22, 2022 15:06
@rparrett
Copy link
Contributor

rparrett commented Sep 22, 2022

Since the bounds are -1.0 to 1.0 for both dimensions on the gamepad stick, I feel a square aspect ratio is most appropriate. I'll set the window to a square size of the minimum dimension, keeping within the window's WindowConstraints.

I mean to say that the bounds can / possibly should be completely independent of the window size. Just show a 200x200 (or whatever) box in the middle of the window.

The goal being not having any "window stuff" at all in this example.

@targrub
Copy link
Contributor Author

targrub commented Sep 22, 2022

I left in setting the window title, but removed my other "window stuff." Set input range box at 300x300 in middle of window.

@rparrett
Copy link
Contributor

Another box below the others to visualize the full bounds would be helpful now.

@targrub
Copy link
Contributor Author

targrub commented Sep 22, 2022

I'm not equipped to make changes much beyond what I've done, since I don't have a gamepad.

@alice-i-cecile
Copy link
Member

Closing in favor of #6074; I think they serve very similar purposes and we should refine the base in that PR <3

@targrub targrub deleted the gamepad-input-example branch October 26, 2022 19:45
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 C-Testing A change that impacts how we test Bevy or how users test their apps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants