bevy-ui-text
Installation
SKILL.md
Bevy UI text
When to use
Load this when a UI node or a 2D world label shows a string. Layout stays on bevy-ui-layout.
ECS shape
- UI: spawn
Texton an entity.TextrequiresNode,TextFont,TextColor, andTextLayout. The string onTextis the first span. - Feature:
bevy_textships withDefaultPlugins. Thedefault_fontfeature embeds a default ASCII font, so aTextwith no customFonthandle still draws. - World text:
Text2drequiresTextFont,TextColor,TextLayout,TextBounds,Anchor, andTransform.Text2dShadowoffsets a second copy of the glyphs. - Systems: the engine runs
update_text2d_layoutinPostUpdateafter the string or style changes. Game systems writeText,Text2d,TextSpan,TextFont, andTextColor. They do not run a second layout pass.
Text is the HUD string. Node places it. One system owns later edits to that string.
#[derive(Component)]
struct ScoreLabel;