2 releases
0.1.1 | Dec 6, 2023 |
---|---|
0.1.0 | Dec 6, 2023 |
#1282 in Game dev
30KB
95 lines
bevy_quit
bevy_quit
is a simple bevy plugin to easily add keybindings to exit a bevy
game.
Example usage
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();
}
Contributing
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
lib.rs
:
bevy_quit
is a simple bevy plugin to easily add keybindings to exit a
bevy game.
Example
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();
}
Dependencies
~23MB
~430K SLoC