diff --git a/examples/demo.rs b/examples/demo.rs index 67b236c..0af374c 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -94,6 +94,9 @@ fn setup( #[derive(Component, Reflect)] pub struct BigSpaceDebugText; +#[derive(Component, Reflect)] +pub struct FunFactText; + fn ui_setup(mut commands: Commands) { commands.spawn(( TextBundle::from_section( @@ -113,6 +116,26 @@ fn ui_setup(mut commands: Commands) { }), BigSpaceDebugText, )); + + commands.spawn(( + TextBundle::from_section( + "", + TextStyle { + font_size: 52.0, + color: Color::WHITE, + ..default() + }, + ) + .with_style(Style { + position_type: PositionType::Absolute, + bottom: Val::Px(10.0), + right: Val::Px(10.0), + left: Val::Px(10.0), + ..default() + }) + .with_text_alignment(TextAlignment::Center), + FunFactText, + )); } fn highlight_nearest_sphere( @@ -129,7 +152,8 @@ fn highlight_nearest_sphere( } fn ui_text_system( - mut text: Query<&mut Text, With>, + mut debug_text: Query<&mut Text, (With, Without)>, + mut fun_text: Query<&mut Text, (With, Without)>, time: Res