added the missing file

This commit is contained in:
Hartmut Seichter 2022-12-14 13:00:47 +01:00
parent c862972f80
commit 5a47c69425

22
src/console.rs Normal file
View file

@ -0,0 +1,22 @@
use bevy::prelude::*;
// this seems to crash
pub fn toggle_fullscreeen(
input: Res<Input<KeyCode>>,
mut windows: ResMut<Windows>,
) {
let window = windows
.get_primary_mut()
.unwrap();
if input.pressed(KeyCode::F) /*&& input.just_pressed(KeyCode::Return) */ {
if window.mode() == WindowMode::Windowed {
window.set_mode(WindowMode::Fullscreen);
} else {
window.set_mode(WindowMode::Windowed);
}
}
}