Skip to content

Commit

Permalink
Fix the text_debug example after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisCode committed Nov 11, 2020
1 parent 97c54d9 commit f748974
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,10 @@ path = "examples/ui/text_debug.rs"
name = "font_atlas_debug"
path = "examples/ui/font_atlas_debug.rs"

[[example]]
name = "text_debug"
path = "examples/ui/text_debug.rs"

[[example]]
name = "ui"
path = "examples/ui/ui.rs"


[[example]]
name = "clear_color"
path = "examples/window/clear_color.rs"
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ pub mod prelude {
}

use bevy_app::prelude::*;
use bevy_ecs::Commands;
use bevy_ecs::IntoSystem;
use bevy_render::render_graph::RenderGraph;
use bevy_render::{prelude::Draw, render_graph::RenderGraph};
use update::ui_z_system;

#[derive(Default)]
Expand Down
14 changes: 8 additions & 6 deletions examples/ui/text_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {

struct TextChanges;

fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
fn infotext_system(commands: &mut Commands, asset_server: Res<AssetServer>) {
let font = asset_server.load("fonts/FiraSans-Bold.ttf");
commands
.spawn(UiCameraComponents::default())
Expand Down Expand Up @@ -127,9 +127,11 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
});
}

fn change_text_system(mut text: Mut<Text>, _: &TextChanges) {
text.value = format!(
"This text changes in the bottom right {}",
rand::random::<u16>(),
);
fn change_text_system(mut query: Query<(&mut Text, &TextChanges)>) {
for (mut text, _text_changes) in query.iter_mut() {
text.value = format!(
"This text changes in the bottom right {}",
rand::random::<u16>(),
);
}
}

0 comments on commit f748974

Please sign in to comment.