mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
3a6f6de277
System Inputs, Outputs, Chaining, and Registration Ergo
19 lines
434 B
Rust
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);
|
|
}
|
|
}
|