From 63fba59b304ee2c92258e3fc3328a25ff7d2b7d3 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Fri, 17 Jan 2025 06:18:29 -0700 Subject: [PATCH] Improve `TextSpan` docs --- crates/bevy_text/src/text.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bevy_text/src/text.rs b/crates/bevy_text/src/text.rs index 06f8adf86c38f..a50d9a8f7820c 100644 --- a/crates/bevy_text/src/text.rs +++ b/crates/bevy_text/src/text.rs @@ -170,11 +170,13 @@ impl TextLayout { /// # use bevy_ecs::world::World; /// # use bevy_text::{Font, TextLayout, TextFont, TextSpan, TextColor}; /// # use bevy_hierarchy::BuildChildren; -/// +/// # /// # let font_handle: Handle = Default::default(); /// # let mut world = World::default(); /// # /// world.spawn(( +/// // `Text` or `Text2d` are needed, and will provide default instances +/// // of the following components. /// TextLayout::default(), /// TextFont { /// font: font_handle.clone().into(), @@ -184,6 +186,7 @@ impl TextLayout { /// TextColor(BLUE.into()), /// )) /// .with_child(( +/// // Children must be `TextSpan`, not `Text` or `Text2d`. /// TextSpan::new("Hello!"), /// TextFont { /// font: font_handle.into(),