Expand description
A Bevy plugin the provides a simple rich text component.
§Examples
See the examples folder.
use bevy::prelude::*;
use bevy_simple_rich_text::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(RichTextPlugin)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera2d);
commands.spawn((
StyleTag::new("red"),
TextColor(Color::hsl(0., 0.9, 0.7)),
));
commands.spawn((RichText::new("[red]Text")));
}Modules§
- prelude
- Commonly used types for
bevy_simple_rich_text.
Structs§
- Default
Style - A marker component for the
StyleTagthat is associated with the default style tag (""). - Rich
Text - The top-level component for rich text for
bevy_ui. - Rich
Text2d - The top-level component for rich text in world-space for 2d cameras.
- Rich
Text Plugin - This plugin adds systems and initializes resources required for processing
RichText. - Rich
Text Systems - A SystemSet containing the systems that process
RichTextand manage [StyleRegistry]. - Style
Tag - A component marking an entity as a “style tag” that can be referred to
by its inner string defining a
RichText. - Style
Tags - A
HashMapcontaining a mapping ofStyleTagtags to theEntitys holding their style components.