2
0
Fork 0
mirror of https://github.com/bevyengine/bevy synced 2024-12-30 06:53:13 +00:00
bevy/examples/input/touch_input.rs
Mikkel Rasmussen e9312254d8
Non-breaking change* from UK spellings to US ()
Fixes issue mentioned in PR .

_Note: By mistake, this is currently dependent on #8285_
# Objective

Ensure consistency in the spelling of the documentation.

Exceptions:
`crates/bevy_mikktspace/src/generated.rs` - Has not been changed from
licence to license as it is part of a licensing agreement.

Maybe for further consistency,
https://github.com/bevyengine/bevy-website should also be given a look.

## Solution

### Changed the spelling of the current words (UK/CN/AU -> US) :
cancelled -> canceled (Breaking API changes in )
behaviour -> behavior (Breaking API changes in )
neighbour -> neighbor
grey -> gray
recognise -> recognize
centre -> center
metres -> meters
colour -> color

### ~~Update [`engine_style_guide.md`]~~ Moved to  

---

## Changelog

Changed UK spellings in documentation to US

## Migration Guide

Non-breaking changes*

\* If merged after 
2023-04-08 16:22:46 +00:00

38 lines
1,000 B
Rust

//! Displays touch presses, releases, and cancels.
use bevy::{input::touch::*, prelude::*};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Update, touch_system)
.run();
}
fn touch_system(touches: Res<Touches>) {
for touch in touches.iter_just_pressed() {
info!(
"just pressed touch with id: {:?}, at: {:?}",
touch.id(),
touch.position()
);
}
for touch in touches.iter_just_released() {
info!(
"just released touch with id: {:?}, at: {:?}",
touch.id(),
touch.position()
);
}
for touch in touches.iter_just_canceled() {
info!("canceled touch with id: {:?}", touch.id());
}
// you can also iterate all current touches and retrieve their state like this:
for touch in touches.iter() {
info!("active touch: {:?}", touch);
info!(" just_pressed: {}", touches.just_pressed(touch.id()));
}
}