docs/bevy/examples/input/touch_input_events.rs 366 B · 16 lines · raw · history

1 //! Prints out all touch inputs.
2
3 use bevy::{input::touch::*, prelude::*};
4
5 fn main() {
6 App::new()
7 .add_plugins(DefaultPlugins)
8 .add_systems(Update, touch_event_system)
9 .run();
10 }
11
12 fn touch_event_system(mut touch_inputs: MessageReader<TouchInput>) {
13 for touch_input in touch_inputs.read() {
14 info!("{:?}", touch_input);
15 }
16 }