| Crates.io | bevy_simple_rich_text |
| lib.rs | bevy_simple_rich_text |
| version | 0.3.0 |
| created_at | 2024-07-05 00:46:15.831082+00 |
| updated_at | 2025-04-24 21:24:05.314787+00 |
| description | A tiny rich text helper for Bevy |
| homepage | https://github.com/rparrett/bevy_simple_rich_text |
| repository | https://github.com/rparrett/bevy_simple_rich_text |
| max_upload_size | |
| id | 1292246 |
| size | 143,705 |
A tiny, unambitious rich text helper for bevy_ui with a simple bbcode-inspired syntax.
// Register style tags by spawning `StyleTag` with `TextFont`, `TextColor`,
// and any other arbitrary Component.
commands.spawn((
StyleTag::new("lg"),
TextFont {
font_size: 40.,
..default()
},
));
commands.spawn((
StyleTag::new("fancy"),
TextColor(Color::hsl(0., 0.9, 0.7)),
FancyText,
));
// And use them
commands.spawn(RichText::new("[lg]Hello [lg,fancy]World"));
See also examples/advanced.rs.
Modifying a RichText completely rebuilds the TextSpans, so it's probably pretty slow.
But you can attach arbitrary marker components to styles to achieve fast animations.
bevy_simple_rich_text |
bevy |
|---|---|
0.3 |
0.16 |
0.2 |
0.15 |
0.1 |
0.14 |
Please feel free to open a PR. The goal of this project isn't to support every feature or use-case, but to be good enough for simple projects while remaining very maintainable.
Please keep PRs small and scoped to a single feature or fix.