bevy_bitmap_text
Current Status: đ§ Early Development (Initial version in progress)
bevy_bitmap_text â Glyph-as-Entity dynamic atlas text rendering for Bevy.
| English | Simplified Chinese |
|---|---|
| English | įŽäŊ䏿 |
Introduction
bevy_bitmap_text is a text rendering backend for Bevy that spawns each character as an
individual ECS entity with a Sprite component.
It solves the limitation of monolithic text meshes, allowing users to apply per-character ECS-driven animations such as
shake, wave, and color changes.
With bevy_bitmap_text, you only need to add a TextBlock component and configure TextBlockStyling â the plugin
handles rasterization, atlas packing, layout, and entity synchronization automatically.
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.