Skip to content

Commit 4592d60

Browse files
committed
Update shader_prepass example to use children! macro
1 parent e21dfe8 commit 4592d60

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

examples/shader/shader_prepass.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,22 @@ fn setup(
123123
Transform::from_xyz(4.0, 8.0, 4.0),
124124
));
125125

126-
commands
127-
.spawn((
128-
Text::default(),
129-
Node {
130-
position_type: PositionType::Absolute,
131-
top: Val::Px(12.0),
132-
left: Val::Px(12.0),
133-
..default()
134-
},
135-
))
136-
.with_children(|p| {
137-
p.spawn(TextSpan::new("Prepass Output: transparent\n"));
138-
p.spawn(TextSpan::new("\n\n"));
139-
p.spawn(TextSpan::new("Controls\n"));
140-
p.spawn(TextSpan::new("---------------\n"));
141-
p.spawn(TextSpan::new("Space - Change output\n"));
142-
});
126+
commands.spawn((
127+
Text::default(),
128+
Node {
129+
position_type: PositionType::Absolute,
130+
top: Val::Px(12.0),
131+
left: Val::Px(12.0),
132+
..default()
133+
},
134+
children![
135+
TextSpan::new("Prepass Output: transparent\n"),
136+
TextSpan::new("\n\n"),
137+
TextSpan::new("Controls\n"),
138+
TextSpan::new("---------------\n"),
139+
TextSpan::new("Space - Change output\n"),
140+
],
141+
));
143142
}
144143

145144
// This is the struct that will be passed to your shader

0 commit comments

Comments
 (0)