bevy-text

Explain Bevy text rendering with Text, Text2d, styling, and font handling.

125|10|Updated Nov 22, 2022
One-click install
npx skills add https://github.com/nolantait/bevy-starter --skill bevy-text
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bevy-text
Source: https://github.com/nolantait/bevy-starter/tree/main/.agents/skills/bevy-text
Command: npx skills add https://github.com/nolantait/bevy-starter --skill bevy-text

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bevy developers need clear guidance on when to use Text versus Text2d, how to style text, and how to render fonts at runtime to build UI and world-space labels.

Core Features & Use Cases

  • Text vs Text2d: guidance on appropriate usage for UI vs world-space text and how to choose the right component.
  • Creating and styling text: examples for both in-scene UI elements, text color, font sizing, and layout.
  • Runtime text updates and interactivity: how to modify text at runtime and respond to clicks or events, including multi-style text through TextSpan.
  • Font support: notes on supported font formats and font loading in Bevy.

Quick Start

Spawn a Text2d for world-space text and a UI Text for UI, then update their content at runtime in response to user input.

Frequently Asked Questions about bevy-text

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the difference between Text and Text2d in Bevy?

In Bevy, Text is used for UI elements like HUDs, while Text2d renders world-space labels across 2D and 3D scenes. Choosing the right component ensures text displays correctly in your specific environment.

How do I style text and change font size in Bevy?

To style text in Bevy, you can modify text color, font sizing, and layout properties directly through the text component. This allows detailed visual customization for both in-scene UI elements and world-space text.

Can I update Bevy text content dynamically at runtime?

Yes, you can update Bevy text content dynamically at runtime in response to user input or events. This includes modifying text strings and applying multi-style text formatting through TextSpan.

How do I load custom fonts in Bevy for rendering text?

Bevy supports loading custom fonts at runtime to render text in your applications. You need to load supported font formats into the Bevy asset system before applying them to your text components.

Does this Bevy text rendering guide apply to 3D scene labels?

Yes, this Bevy text rendering guide applies to 3D scene labels. It covers using Text2d to create and interact with world-space labels across both 2D and 3D scenes in Bevy.