-
-
Notifications
You must be signed in to change notification settings - Fork 744
Add get mouse button fn input utils #1582
Add get mouse button fn input utils #1582
Conversation
@@ -78,6 +79,8 @@ extra bounds from `AnimatablePrefab` and `AnimationSetPrefab` ([#1435]) | |||
* `NetConnection` is automatically created when client starts sends data to server. ([#1539]) | |||
* User will receive `NetEvent::Connected` on new connection and `NetEvent::Dissconnected` on disconnect. ([#1539]) | |||
* Added a `pivot` field to `UiTransform`. ([#1571]) | |||
* Fix fly_camera example initial camera and cube position. ([#1582]) | |||
* Add to fly_camera example code to release and capture back mouse input, and to show and hide cursor. ([#1582]) |
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.
please also add the link to the #1582 pr. you can see how it is done for other pull requests a bit lower in the same file.
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.
Okay!
4d80255
to
f72a6c7
Compare
@Jojolepro, I have fixed the changelog file and also fixed merge conflict there. |
Thanks for reviewing! It seems Jenkins hadn't started checks yet. Is some action required at this point? |
yeap, just this 😄: bors r=jojolepro, jaynus |
Merge conflict (retrying...) |
1 similar comment
Merge conflict (retrying...) |
Merge conflict |
f72a6c7
to
988566a
Compare
bors r=jojolepro, jaynus |
🔒 Permission denied Existing reviewers: click here to make alex-eg a reviewer |
Oh it seems I didn't quite understood how bors works. |
bors r=jojolepro, jaynus |
1582: Add get mouse button fn input utils r=jojolepro,jaynus a=alex-eg ## Description I found myself in need of functions to get mouse button state from `Event` instance in state `handle_event` function, so I wrote a couple. It also seemed to me that as they are analogous to `get_key` and `is_key_down` for keyboard key status, new functions should reside in the same file, so I placed it in amethyst_input/util.rs Then I enhanced a bit fly_camera example to demonstrate how to capture and release mouse input and hide and show cursor. Here I made use of newly created functions. It also turned out that fly_camera example behaves a bit odd, so I fixed this by providing explicit transform for it's prefab. ## Additions `get_mouse_button` function to amethist_utlils `is_mouse_button_pressed` function to amethist_utils ## Removals None. ## Modifications fly_camera example: add cursor show/hide, mouse input release/capture, also fix prefab so mouse lookout directions are not inverted, and camera looks at cube at the start. ## PR Checklist By placing an x in the boxes I certify that I have: - [x] Ran `cargo test --all` locally if this modified any rs files. - [x] Ran `cargo +stable fmt --all` locally if this modified any rs files. - [x] Updated the content of the book if this PR would make the book outdated. - [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment. - [x] Added unit tests for new APIs if any were added in this PR. - [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme. Co-authored-by: taptap <alexey.e.egorov@gmail.com>
bors r- |
Canceled |
Add two functions: get_mouse_button and is_mouse_button_down, analoguous to get_key and is_key_down for keyboard keys.
Due to void transform component, camera loaded from prefab with up vector pointing down y aixs, i.e. mouse lookout left and right direction were swapped. Cube position seemed a bit to distant, so it moved closer to the viewer. Add to flying camera example cursor uncapture and re-capture Also add info about it to examples README.md.
988566a
to
4df3627
Compare
bors r=jojolepro, jaynus |
1582: Add get mouse button fn input utils r=jojolepro,jaynus a=alex-eg ## Description I found myself in need of functions to get mouse button state from `Event` instance in state `handle_event` function, so I wrote a couple. It also seemed to me that as they are analogous to `get_key` and `is_key_down` for keyboard key status, new functions should reside in the same file, so I placed it in amethyst_input/util.rs Then I enhanced a bit fly_camera example to demonstrate how to capture and release mouse input and hide and show cursor. Here I made use of newly created functions. It also turned out that fly_camera example behaves a bit odd, so I fixed this by providing explicit transform for it's prefab. ## Additions `get_mouse_button` function to amethist_utlils `is_mouse_button_pressed` function to amethist_utils ## Removals None. ## Modifications fly_camera example: add cursor show/hide, mouse input release/capture, also fix prefab so mouse lookout directions are not inverted, and camera looks at cube at the start. ## PR Checklist By placing an x in the boxes I certify that I have: - [x] Ran `cargo test --all` locally if this modified any rs files. - [x] Ran `cargo +stable fmt --all` locally if this modified any rs files. - [x] Updated the content of the book if this PR would make the book outdated. - [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment. - [x] Added unit tests for new APIs if any were added in this PR. - [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme. Co-authored-by: taptap <alexey.e.egorov@gmail.com>
Build succeeded |
Description
I found myself in need of functions to get mouse button state from
Event
instance in statehandle_event
function, so I wrote a couple.It also seemed to me that as they are analogous to
get_key
andis_key_down
for keyboard key status, new functions should reside in the same file, so I placed it in amethyst_input/util.rsThen I enhanced a bit fly_camera example to demonstrate how to capture and release mouse input and hide and show cursor. Here I made use of newly created functions.
It also turned out that fly_camera example behaves a bit odd, so I fixed this by providing explicit transform for it's prefab.
Additions
get_mouse_button
function to amethist_utlilsis_mouse_button_pressed
function to amethist_utilsRemovals
None.
Modifications
fly_camera example: add cursor show/hide, mouse input release/capture, also fix prefab so mouse lookout directions are not inverted, and camera looks at cube at the start.
PR Checklist
By placing an x in the boxes I certify that I have:
cargo test --all
locally if this modified any rs files.cargo +stable fmt --all
locally if this modified any rs files.