diff --git a/src/hud.rs b/src/hud.rs index cc75117..4914cd9 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -12,7 +12,6 @@ impl Plugin for OutFlyHudPlugin { } const FONT: &str = "tmp/fonts/NotoSansSC-Thin.ttf"; -const FONT_SIZE: f32 = 50.0; #[derive(Component)] struct FpsText; @@ -32,10 +31,10 @@ fn setup( }; let mut bundle_fps = TextBundle::from_sections([ TextSection::new( - "帧率 ", + " 帧率 ", TextStyle { font: asset_server.load(FONT), - font_size: FONT_SIZE, + font_size: settings.font_size_hud, color: Color::GRAY, ..default() }, @@ -44,7 +43,7 @@ fn setup( "", TextStyle { font: asset_server.load(FONT), - font_size: FONT_SIZE, + font_size: settings.font_size_hud, color: Color::GRAY, ..default() } diff --git a/src/settings.rs b/src/settings.rs index b219f26..044614f 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -6,6 +6,8 @@ pub struct Settings { pub mute_music: bool, pub volume_sfx: u8, pub volume_music: u8, + pub font_size_hud: f32, + pub font_size_conversations: f32, pub key_togglehud: KeyCode, pub ar_active: bool, } @@ -17,6 +19,8 @@ impl Default for Settings { mute_music: false, volume_sfx: 100, volume_music: 100, + font_size_hud: 32.0, + font_size_conversations: 32.0, key_togglehud: KeyCode::Tab, ar_active: true, }