File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 6
6
use bevy:: {
7
7
diagnostic:: { Diagnostics , FrameTimeDiagnosticsPlugin } ,
8
8
prelude:: * ,
9
+ text:: DefaultFont ,
9
10
} ;
10
11
11
12
fn main ( ) {
12
13
App :: new ( )
13
14
. add_plugins ( DefaultPlugins )
14
15
. add_plugin ( FrameTimeDiagnosticsPlugin :: default ( ) )
16
+ . insert_resource ( DefaultFont {
17
+ // Configure a default font that will be applied to all text node without a specified font
18
+ path : Some ( "fonts/FiraMono-Medium.ttf" . into ( ) ) ,
19
+ } )
15
20
. add_startup_system ( setup)
16
21
. add_system ( text_update_system)
17
22
. add_system ( text_color_system)
@@ -70,7 +75,8 @@ fn setup(mut commands: Commands) {
70
75
} ,
71
76
) ,
72
77
TextSection :: from_style ( TextStyle {
73
- font : "fonts/FiraMono-Medium.ttf" . into ( ) ,
78
+ // Use the default font instead of manually specifying a font
79
+ font : default ( ) ,
74
80
font_size : 60.0 ,
75
81
color : Color :: GOLD ,
76
82
} ) ,
You can’t perform that action at this time.
0 commit comments