diff --git a/examples/tetris/assets/font.png b/examples/tetris/assets/font.png new file mode 100644 index 0000000..5526f96 Binary files /dev/null and b/examples/tetris/assets/font.png differ diff --git a/examples/tetris/layer.rs b/examples/tetris/layer.rs index b50e6dd..e139f5e 100644 --- a/examples/tetris/layer.rs +++ b/examples/tetris/layer.rs @@ -61,7 +61,7 @@ impl SimpleGameLayer for TetrisLayer { fn add_score_ui(world: &mut World) -> Entity { // First we add an UiText to the world let font = Font::Bitmap { - texture_path: app_base_path().join("assets/tetris/font.png").get(), + texture_path: asset_path().join("font.png").get(), chars: "0123456789ACEOPRSULI".to_string(), texture_columns: 20., texture_lines: 1., diff --git a/src/application.rs b/src/application.rs index a427b9d..41c3b8a 100644 --- a/src/application.rs +++ b/src/application.rs @@ -286,8 +286,10 @@ impl ScionBuilder { } fn init_schedule_with_internal_systems(&mut self) { + self.schedule_builder + .add_system(ui_text_bitmap_update_system()); + self.schedule_builder.flush(); self.schedule_builder.add_system(children_manager_system()); - self.schedule_builder .add_system(missing_ui_component_system::()); self.schedule_builder @@ -300,8 +302,7 @@ impl ScionBuilder { self.schedule_builder.add_system(dirty_child_system()); self.schedule_builder.flush(); self.schedule_builder.add_system(dirty_transform_system()); - self.schedule_builder - .add_system(ui_text_bitmap_update_system()); + self.schedule_builder .add_system(compute_collisions_system()); self.schedule_builder.flush(); diff --git a/src/core/systems/ui_text_system.rs b/src/core/systems/ui_text_system.rs index 5022731..49df6ca 100644 --- a/src/core/systems/ui_text_system.rs +++ b/src/core/systems/ui_text_system.rs @@ -67,8 +67,7 @@ pub(crate) fn ui_text_bitmap_update( let mut char_transform = Transform::new( Coordinates::new( - transform.translation().x() + (index as f32 * (width + 1.)), - transform.translation().y(), + (index as f32 * (width + 1.)),0., ), 1.0, 0.,