Skip to content

Commit

Permalink
Improve TextSpan docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Jan 17, 2025
1 parent b66c3ce commit 63fba59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_text/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Font> = 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(),
Expand All @@ -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(),
Expand Down

0 comments on commit 63fba59

Please # to comment.