Bevy plugin to easily create UI text popups using events
APACHE-2.0 License
Bevy plugin to easily create UI text popups with events.
Popups are meant to be short-lived and on top of all other UI components.
Useful for notifications and prompting user input.
Current Customization Options:
cargo run --example custom_font
cargo run --example border
cargo run --example buttons
cargo run --example modal
Upcoming Customization Options:
This example will display a modal popup for 10s with a 'Close' button.
use bevy::prelude::*;
use bevy_text_popup::{TextPopupEvent, TextPopupPlugin, TextPopupTimeout};
fn main() {
App::new()
.add_plugins((DefaultPlugins, TextPopupPlugin))
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands, mut text_popup_events: EventWriter<TextPopupEvent>) {
commands.spawn(Camera2dBundle::default());
text_popup_events.send(TextPopupEvent {
content: "Modal Example".to_string(),
modal: Some(Color::BLUE.with_a(0.75)),
timeout: TextPopupTimeout::Seconds(10),
dismiss_button: Some(TextPopupButton {
text: "Close".to_string(),
..Default::default()
}),
..default()
});
}
cargo run --example buttons
cargo run --example border
cargo run --example custom_font
cargo run --example locations
cargo run --example modal
cargo run --example transparency
bevy | bevy_text_popup |
---|---|
0.14 | 0.4 |
0.13 | 0.3 |
0.12 | 0.2 |
0.11 | 0.1 |