Crates.io | bevy_text_popup |
lib.rs | bevy_text_popup |
version | |
source | src |
created_at | 2023-08-24 00:21:50.775275 |
updated_at | 2024-12-06 01:04:51.568657 |
description | Easily create temporary text pop-up nodes in the Bevy game engine |
homepage | |
repository | https://github.com/edouardpoitras/bevy_text_popup |
max_upload_size | |
id | 952994 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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, TextPopupButton};
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(Camera2d::default());
text_popup_events.send(TextPopupEvent {
content: "Modal Example".to_string(),
modal: Some(Color::linear_rgba(0., 0., 1., 0.75).into()),
timeout: TextPopupTimeout::Seconds(10),
dismiss_button: Some(TextPopupButton {
text: "Close".to_string(),
text_color: TextColor::from(Color::BLACK),
background_color: Color::linear_rgb(1., 1., 1.).into(),
..Default::default()
}),
name: Some(Name::new("custom_popup_name")), // Name component will be added to entity.
..default()
});
}
cargo run --example buttons
cargo run --example border
cargo run --example custom_font
cargo run --example locations
And example showing custom pixel coordinates:
cargo run --example custom_locations
cargo run --example modal
cargo run --example transparency
bevy | bevy_text_popup |
---|---|
0.15 | 0.5 |
0.14 | 0.4 |
0.13 | 0.3 |
0.12 | 0.2 |
0.11 | 0.1 |