#bevy-plugin #bevy #text-rendering #gamedev #bevy-text

bevy_stroked_text

A Bevy plugin for stroked text rendering

3 unstable releases

0.2.0 Feb 25, 2024
0.1.1 Feb 9, 2024
0.1.0 Feb 9, 2024

#374 in Game dev

Download history 4/week @ 2024-02-09 17/week @ 2024-02-16 190/week @ 2024-02-23 34/week @ 2024-03-01 4/week @ 2024-03-08 45/week @ 2024-03-29 17/week @ 2024-04-05 55/week @ 2024-04-12 7/week @ 2024-04-19

124 downloads per month
Used in ryot

MIT/Apache

455KB
129 lines

bevy_stroked_text

crates.io MIT/Apache 2.0 docs.rs

A Bevy plugin for stroked text rendering. This plugin is experimental and may not have performance or quality suitable for production use. The way this plugin works currently is by rendering 8 copies of the text with a 1 pixel offset in each direction, then rendering the original text on top of that. This is not the most efficient way to render stroked text, but it is the easiest to implement and works well enough for now.

CleanShot 2024-02-08 at 22 55 49@2x

Usage

Add the plugin to your app

App::new()
    .add_plugins((DefaultPlugins, StrokedTextPlugin))
    .run();

Add a StrokedTextBundle to your entity

    commands.spawn(
        StrokedTextBundle::new(StrokedText {
            text: "Hello, world!".to_string(),
            font_size: 32.0,
            text_anchor: bevy::sprite::Anchor::Center,
            ..Default::default()
        })
        .with_transform(Transform::from_translation(Vec3::Z).with_scale(Vec3::splat(0.25))),
    );

Bevy Version

bevy bevy_stroked_text
0.12 0.10, main

License

bevy_stroked_text is dual-licensed under either

at your option.

Contributions

PRs welcome!

Dependencies

~41–81MB
~1.5M SLoC