bevy/examples/input/touch_input_events.rs
Carter Anderson 3a6f6de277
System Inputs, Outputs, Chaining, and Registration Ergo (#876)
System Inputs, Outputs, Chaining, and Registration Ergo
2020-11-16 18:18:00 -08:00

19 lines
434 B
Rust

use bevy::{input::touch::*, prelude::*};
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_system(touch_event_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);
}
}