bevy_pretty_text

Crates.iobevy_pretty_text
lib.rsbevy_pretty_text
version0.4.0
created_at2025-07-20 21:46:25.002624+00
updated_at2026-01-17 22:39:37.763257+00
descriptionText effect library for Bevy
homepage
repositoryhttps://github.com/void-scape/pretty-text
max_upload_size
id1761451
size341,916
nic (void-scape)

documentation

README

crates.io docs.rs

Pretty Text is a text effects library for Bevy.

Demos

cargo run --bin showcase

All text effects

cargo run --bin typewriter

A typewriter demonstration

[!NOTE] demo uses an older version of bevy_pretty_text with a different syntax because one of its dependencies is not updated.

cargo run --bin demo

Bevy game demo

Getting Started

First, add bevy_pretty_text to the dependencies in your Cargo.toml:

[dependencies]
bevy_pretty_text = "0.4"

Then, you'll need to add the PrettyTextPlugin to your app.

use bevy::prelude::*;
use bevy_pretty_text::prelude::*;

fn main() {
    App::default()
        .add_plugins((DefaultPlugins, PrettyTextPlugin))
        .run();
}

And then you can make some pretty text!

fn spawn_text(mut commands: Commands, mut materials: ResMut<Assets<Rainbow>>) {
    // Spawn wavy `Text`.
    commands.spawn((
        Text::new("Hello, World!"),
        Wave::default(),
        TextFont::from_font_size(52.0),
    ));

    // Use the typewriter.
    commands.spawn((
        Typewriter::new(30.),
        Text2d::new("My text is revealed\none glyph at a time"),
        Transform::from_xyz(0., 200., 0.),
        TextFont::from_font_size(36.0),
    ));

    // Spawn a style entity.
    commands.spawn((
        PrettyStyle("my_style"),
        TextFont::from_font_size(48.0),
        effects![
            PrettyTextMaterial(materials.add(Rainbow::default())),
            Wave::default(),
        ],
    ));

    // Parse rich text and use custom style.
    commands.spawn((
        pretty!("I am |1|<0.8>*sniff*|1|<1.2> very [pretty](my_style)!|3|<1>"),
        Typewriter::new(10.0),
        TextFont::from_font_size(52.0),
        Node {
            position_type: PositionType::Absolute,
            left: Val::Px(0.0),
            bottom: Val::Px(0.0),
            ..Default::default()
        },
    ));
}
Example code demonstration

The repository examples should help you get up to speed on common usage patterns.

Feature flags

Flag Description Default feature
serialize Enable serialization for ParsedPrettyText. No

Bevy version compatibility

bevy bevy_pretty_text
0.18 0.4
0.17 0.3
0.16 0.1-0.2

License

Pretty Text is free and open source. All code in this repository is dual-licensed under either:

at your option.

Commit count: 147

cargo fmt