mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
19 lines
443 B
Rust
19 lines
443 B
Rust
use bevy::{input::touch::*, prelude::*};
|
|
|
|
fn main() {
|
|
App::build()
|
|
.add_plugins(DefaultPlugins)
|
|
.add_system(touch_event_system.system())
|
|
.run();
|
|
}
|
|
|
|
#[derive(Default)]
|
|
struct State {
|
|
event_reader: EventReader<TouchInput>,
|
|
}
|
|
|
|
fn touch_event_system(mut state: Local<State>, touch_events: Res<Events<TouchInput>>) {
|
|
for event in state.event_reader.iter(&touch_events) {
|
|
println!("{:?}", event);
|
|
}
|
|
}
|