Skip to content

Commit

Permalink
fix font_atlas_debug example
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Nov 13, 2020
1 parent 73fdaf9 commit 1549811
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions examples/ui/font_atlas_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ fn atlas_render_system(
}

fn text_update_system(mut state: ResMut<State>, time: Res<Time>, mut query: Query<&mut Text>) {
for mut text in query.iter_mut() {
let c = rand::random::<u8>() as char;
if !text.value.contains(c) && state.timer.tick(time.delta_seconds).finished {
text.value = format!("{}{}", text.value, c);
state.timer.reset();
if state.timer.tick(time.delta_seconds).finished {
for mut text in query.iter_mut() {
let c = rand::random::<u8>() as char;
if !text.value.contains(c) {
text.value = format!("{}{}", text.value, c);
}
}

state.timer.reset();
}
}

Expand Down

0 comments on commit 1549811

Please sign in to comment.