| Crates.io | bevy_quit |
| lib.rs | bevy_quit |
| version | 0.1.1 |
| created_at | 2023-12-06 10:31:03.913699+00 |
| updated_at | 2023-12-06 10:55:55.883244+00 |
| description | Simple plugin to easily add keybinds to exit a bevy game |
| homepage | |
| repository | https://github.com/jotare/bevy_quit |
| max_upload_size | |
| id | 1059869 |
| size | 112,487 |
bevy_quit is a simple bevy plugin to easily add keybindings to exit a bevy
game.
use bevy::prelude::*;
use bevy_quit::QuitPlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(
QuitPlugin::default() // default will add C-q
.add_key_binding(KeyCode::Escape)
.add_key_binding((KeyCode::ControlLeft, KeyCode::W))
.add_key_binding(vec![
KeyCode::ControlLeft,
KeyCode::ShiftLeft,
KeyCode::AltLeft,
KeyCode::C,
]),
)
.run();
}
Contributions are more than welcome. However, to make code more standard,
pre-commit is used. Please, install it and run it
before submitting any code to this repo. Thanks!
To install the pre-commit hooks, execute:
pre-commit install