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

0.15 release notes: Fix a few minor formatting issues #1877

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ fn gamepad_system(
if button_inputs.just_pressed(
GamepadButton::new(gamepad, GamepadButtonType::South)
) {
println!("just pressed South");
}
info!("just pressed South");
}

let right_trigger = button_axes
.get(GamepadButton::new(
gamepad,
GamepadButtonType::RightTrigger2,
))
.unwrap();
if right_trigger.abs() > 0.01 {
info!("RightTrigger2 value is {}", right_trigger);
info!("RightTrigger2 value is {}", right_trigger);
}

let left_stick_x = axes
.get(GamepadAxis::new(gamepad, GamepadAxisType::LeftStickX))
.unwrap();
if left_stick_x.abs() > 0.01 {
info!("LeftStickX value is {}", left_stick_x);
info!("LeftStickX value is {}", left_stick_x);
}
}
}
Expand All @@ -46,18 +46,18 @@ In 0.15, we can write this much more simply as:
```rust
fn gamepad_system(gamepads: Query<&Gamepad>) {
for gamepad in &gamepads {
if gamepad.just_pressed(GamepadButton::South) {
if gamepad.just_pressed(GamepadButton::South) {
println!("just pressed South");
}
}

let right_trigger = gamepad.get(GamepadButton::RightTrigger2).unwrap();
if right_trigger.abs() > 0.01 {
info!("RightTrigger2 value is {}", right_trigger);
info!("RightTrigger2 value is {}", right_trigger);
}

let left_stick_x = gamepad.get(GamepadAxis::LeftStickX).unwrap();
if left_stick_x.abs() > 0.01 {
info!("LeftStickX value is {}", left_stick_x);
info!("LeftStickX value is {}", left_stick_x);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`bevy_reflect`] is powered by many different traits working together
[`bevy_reflect`] is powered by many different traits working together
to provide the full reflection API. These include traits like [`Reflect`], but also other traits
like [`TypePath`], [`Typed`], and [`GetTypeRegistration`].

Expand All @@ -13,4 +13,4 @@ supertraits of `Reflectable`, allowing it to be used in place of all of them whe
[`TypePath`]: https://docs.rs/bevy_reflect/0.15/bevy_reflect/trait.TypePath.html
[`Typed`]: https://docs.rs/bevy_reflect/0.15/bevy_reflect/trait.Typed.html
[`GetTypeRegistration`]: https://docs.rs/bevy_reflect/0.15/bevy_reflect/trait.GetTypeRegistration.html
[`Reflectable`]: https://docs.rs/bevy_reflect/0.15/bevy_reflect/trait.Reflectable.html
[`Reflectable`]: https://docs.rs/bevy_reflect/0.15/bevy_reflect/trait.Reflectable.html
Loading