Skip to content

Commit 61c6bd9

Browse files
committed
Update testbed_2d example to use children! macro
1 parent 4592d60 commit 61c6bd9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

examples/testbed/2d.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,19 @@ mod text {
222222
Transform::from_translation(dest + Vec3::Z),
223223
anchor,
224224
StateScoped(super::Scene::Text),
225+
children![
226+
(
227+
TextSpan::new(format!("{anchor:?}\n")),
228+
TextFont::from_font_size(14.0),
229+
TextColor(palettes::tailwind::BLUE_400.into()),
230+
),
231+
(
232+
TextSpan::new(format!("{justify:?}")),
233+
TextFont::from_font_size(14.0),
234+
TextColor(palettes::tailwind::GREEN_400.into()),
235+
),
236+
],
225237
));
226-
text.with_children(|parent| {
227-
parent.spawn((
228-
TextSpan::new(format!("{anchor:?}\n")),
229-
TextFont::from_font_size(14.0),
230-
TextColor(palettes::tailwind::BLUE_400.into()),
231-
));
232-
parent.spawn((
233-
TextSpan::new(format!("{justify:?}")),
234-
TextFont::from_font_size(14.0),
235-
TextColor(palettes::tailwind::GREEN_400.into()),
236-
));
237-
});
238238

239239
if let Some(bounds) = bounds {
240240
text.insert(bounds);

0 commit comments

Comments
 (0)