fix: keep font loaded
This commit is contained in:
parent
214e55d7ac
commit
d9232fd5f0
7 changed files with 25 additions and 25 deletions
10
src/menu.rs
10
src/menu.rs
|
|
@ -8,7 +8,7 @@ use bevy::{
|
|||
pub struct MenuPlugin;
|
||||
|
||||
#[derive(Component)]
|
||||
struct Menu();
|
||||
struct Menu;
|
||||
|
||||
impl Plugin for MenuPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
|
|
@ -19,7 +19,7 @@ impl Plugin for MenuPlugin {
|
|||
}
|
||||
|
||||
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
let font = asset_server.get_handle("Cantarell-VF.otf");
|
||||
let font = asset_server.get_handle("UacariLegacy-Thin.ttf");
|
||||
commands
|
||||
.spawn_bundle(Text2dBundle {
|
||||
text: Text::from_section(
|
||||
|
|
@ -31,10 +31,10 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||
},
|
||||
)
|
||||
.with_alignment(TextAlignment::CENTER),
|
||||
transform: Transform::from_xyz(0., -128.0, 0.),
|
||||
transform: Transform::from_xyz(0., 128.0, 0.),
|
||||
..Default::default()
|
||||
})
|
||||
.insert(Menu());
|
||||
.insert(Menu);
|
||||
commands
|
||||
.spawn_bundle(Text2dBundle {
|
||||
text: Text::from_section(
|
||||
|
|
@ -48,7 +48,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||
.with_alignment(TextAlignment::CENTER),
|
||||
..Default::default()
|
||||
})
|
||||
.insert(Menu());
|
||||
.insert(Menu);
|
||||
}
|
||||
|
||||
fn despawn(mut commands: Commands, menu_query: Query<Entity, With<Menu>>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue