Crate bevy_notify

source ·
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(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

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.
Single notification or toast
Container for options for initlizing toasts
Main notifications collector.

Enums

Anchor where to show toasts
Level of importance

Functions

For use in tests; especially doctests.