diff --git a/examples/ui/text_debug.rs b/examples/ui/text_debug.rs index 856e934efd0a8..ffa1078038e54 100644 --- a/examples/ui/text_debug.rs +++ b/examples/ui/text_debug.rs @@ -1,10 +1,17 @@ -use bevy::prelude::*; -extern crate rand; +use bevy::{ + diagnostic::{Diagnostics, FrameTimeDiagnosticsPlugin}, + prelude::*, +}; /// This example is for debugging text layout fn main() { App::build() + .add_resource(WindowDescriptor { + vsync: false, + ..Default::default() + }) .add_plugins(DefaultPlugins) + .add_plugin(FrameTimeDiagnosticsPlugin) .add_startup_system(infotext_system) .add_system(change_text_system) .run(); @@ -83,7 +90,7 @@ fn infotext_system(commands: &mut Commands, asset_server: Res) { value: "This text changes in the bottom right".to_string(), font: font.clone(), style: TextStyle { - font_size: 50.0, + font_size: 30.0, color: Color::WHITE, alignment: TextAlignment::default(), }, @@ -120,11 +127,31 @@ fn infotext_system(commands: &mut Commands, asset_server: Res) { }); } -fn change_text_system(mut query: Query<(&mut Text, &TextChanges)>) { - for (mut text, _text_changes) in query.iter_mut() { +fn change_text_system( + time: Res