bevy_bitmap_text
bevy_bitmap_text — Glyph-as-Entity dynamic atlas text rendering for Bevy.
| English | Simplified Chinese |
|---|---|
| English | 简体中文 |
Introduction
Standard text rendering in game engines is usually a monolith: an entire sentence gets baked into a single mesh. But what if you want just one specific letter to shake violently, bounce up and down, or dynamically shift its color? Especially for pixel games, trying to achieve that classic, expressive "retro" feel within high-level modern text systems can be surprisingly frustrating.
So I thought: why not simplify everything and go back to the bitmap approach? That's how bevy_bitmap_text came to be.
It is a text rendering backend for Bevy that spawns each character as its own independent
ECS entity with a Sprite component.
By treating glyphs as individual bitmap sprites, it hands the power back to Bevy's standard ECS. You want a word to wave
like a flag? Just attach a WaveEffect component to those character entities. The plugin automatically handles the
heavy lifting: on-the-fly font rasterization, atlas packing, layout, and keeping all those entities synchronized.
— that's it, a simple text alternative. Take it if you want.
Features
- 🧩 Glyph-as-Entity architecture — each character is a separate
Spriteentity, enabling per-character animation and styling via standard ECS - 🔠 Dynamic glyph atlas — on-demand rasterization with fontdue and rectangle packing via etagere
- ⌨️ Typewriter effect — built-in
GlyphRevealcomponent for progressive character reveal - ✨ Per-character effects —
ShakeEffectandWaveEffectcomponents for jitter and sine-wave animations - 🎨 Color tags — inline
{#RRGGBB:text}markup for per-segment coloring - 🖌️ Text styling — configurable font, size, color, alignment, anchor, line height, character spacing, and word spacing
- ↩️ Auto line-wrapping — optional
max_widthfor automatic word wrap
How to Use
-
Add the dependency to your
Cargo.toml:[] = { = "crates/bevy_bitmap_text" } -
Register the plugin:
use *; use ; -
Spawn a text block:
use *; -
Typewriter effect:
commands.spawn; // Increment `visible_count` each frame to reveal characters one by one. -
Color tags:
use parse_text_to_segments; let segments = parse_text_to_segments; commands.spawn;
How to Build
Prerequisites
- Rust 1.85 or later (edition 2024)
- Bevy 0.18
Build Steps
-
Build the crate:
-
Run tests:
-
Run the demo:
Dependencies
This project uses the following crates:
| Crate | Version | Description |
|---|---|---|
| bevy | 0.18 | Game engine framework (asset, color, render, sprite) |
| fontdue | 0.7 | Lightweight font rasterization |
| etagere | 0.2 | Rectangle atlas packing |
| log | 0.4 | Logging facade |
Contributing
Contributions are welcome! Whether you want to fix a bug, add a feature, or improve documentation:
- Submit an Issue or Pull Request.
- Share ideas and discuss design or architecture.
License
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.