Expand description
§bevy-notify
bevy-notify
is a bevy plugin wrapping egui_notify and
adding an event receiver to your bevy app. Toast notifications can then be send
in your bevy app at any point.
§Examples
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(NotifyPlugin)
.add_plugin(EguiPlugin)
.insert_resource(Notifications(Toasts::default()))
.add_system(notify_example_system)
.run();
}
fn notify_example_system(key_input: Res<Input<KeyCode>>, mut events: ResMut<Events<Toast>>) {
if key_input.just_pressed(KeyCode::Space) {
events.send(Toast::success("Space pressed"));
}
}
Structs§
- Notifications
- Notify
Plugin - Adds an event resource for Toast nofications to your bevy app. A system is added that will show received toast events through an egui context.
- Toast
- Single notification or toast
- Toast
Options - Container for options for initlizing toasts
- Toasts
- Main notifications collector.
Enums§
- Anchor
- Anchor where to show toasts
- Toast
Level - Level of importance
Functions§
- __
run_ test_ ctx - For use in tests; especially doctests.