File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ fn main() {
13
13
. register_component :: < ComponentB > ( )
14
14
. add_startup_system ( save_scene_system. thread_local_system ( ) )
15
15
. add_startup_system ( load_scene_system. system ( ) )
16
+ . add_startup_system ( infotext_system. system ( ) )
16
17
. add_system ( print_system. system ( ) )
17
18
. run ( ) ;
18
19
}
@@ -128,3 +129,25 @@ fn save_scene_system(_world: &mut World, resources: &mut Resources) {
128
129
129
130
// TODO: save scene
130
131
}
132
+
133
+ // This is only necessary for the info message in the UI. See examples/ui/text.rs for a standalone text example.
134
+ fn infotext_system ( mut commands : Commands , asset_server : Res < AssetServer > ) {
135
+ let font_handle = asset_server. load ( "assets/fonts/FiraSans-Bold.ttf" ) . unwrap ( ) ;
136
+ commands
137
+ . spawn ( UiCameraComponents :: default ( ) )
138
+ . spawn ( TextComponents {
139
+ style : Style {
140
+ align_self : AlignSelf :: FlexEnd ,
141
+ ..Default :: default ( )
142
+ } ,
143
+ text : Text {
144
+ value : "Nothing to see in this window! Check the console output!" . to_string ( ) ,
145
+ font : font_handle,
146
+ style : TextStyle {
147
+ font_size : 50.0 ,
148
+ color : Color :: WHITE ,
149
+ } ,
150
+ } ,
151
+ ..Default :: default ( )
152
+ } ) ;
153
+ }
You can’t perform that action at this time.
0 commit comments