fix: keep font loaded
This commit is contained in:
parent
214e55d7ac
commit
d9232fd5f0
7 changed files with 25 additions and 25 deletions
31
src/game.rs
31
src/game.rs
|
|
@ -223,7 +223,6 @@ fn collision_event_system(
|
|||
if app_state.current() == &AppState::Game
|
||||
&& 4. - new_color.length_squared() < 0.1
|
||||
{
|
||||
println!("win");
|
||||
app_state.replace(AppState::Win).ok();
|
||||
}
|
||||
|
||||
|
|
@ -326,22 +325,22 @@ fn keyboard_input_system(
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: the text is not visible, I don't know why.
|
||||
fn win_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
println!("win system");
|
||||
let font = asset_server.get_handle("Cantarell-VF.otf");
|
||||
commands.spawn_bundle(Text2dBundle {
|
||||
text: Text::from_section(
|
||||
"Press ENTER to level up",
|
||||
TextStyle {
|
||||
font,
|
||||
font_size: 32.0,
|
||||
color: Color::WHITE,
|
||||
},
|
||||
)
|
||||
.with_alignment(TextAlignment::CENTER),
|
||||
..Default::default()
|
||||
});
|
||||
let font = asset_server.get_handle("UacariLegacy-Thin.ttf");
|
||||
commands
|
||||
.spawn_bundle(Text2dBundle {
|
||||
text: Text::from_section(
|
||||
"Press ENTER to level up",
|
||||
TextStyle {
|
||||
font,
|
||||
font_size: 32.0,
|
||||
color: Color::WHITE,
|
||||
},
|
||||
)
|
||||
.with_alignment(TextAlignment::CENTER),
|
||||
..Default::default()
|
||||
})
|
||||
.insert(Level);
|
||||
}
|
||||
|
||||
// Sounds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue