From 875b7492c878fbdc24c79878ef013ed9aaed04ea Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sun, 12 Jan 2020 18:00:58 -0800 Subject: [PATCH] rename ui_update_system --- examples/instancing.rs | 1 - examples/ui.rs | 24 +++++++++++++++++-- src/app/app_builder.rs | 2 +- src/ui/mod.rs | 2 +- .../{update_system.rs => ui_update_system.rs} | 0 5 files changed, 24 insertions(+), 5 deletions(-) rename src/ui/{update_system.rs => ui_update_system.rs} (100%) diff --git a/examples/instancing.rs b/examples/instancing.rs index 71a0898213..2a8ed269eb 100644 --- a/examples/instancing.rs +++ b/examples/instancing.rs @@ -183,7 +183,6 @@ fn build_print_status_system() -> Box { frame_time_total -= frame_time_values.pop_back().unwrap(); } if elapsed > 1.0 { - // println!("fps: {}", if time.delta_seconds == 0.0 { 0.0 } else { 1.0 / time.delta_seconds }); if frame_time_count > 0 && frame_time_total > 0.0 { println!( "fps: {}", diff --git a/examples/ui.rs b/examples/ui.rs index 35535d81d3..ebe7d83ac1 100644 --- a/examples/ui.rs +++ b/examples/ui.rs @@ -90,8 +90,18 @@ fn setup(world: &mut World) { vec![(Node::new( math::vec2(0.0, 0.0), Anchors::new(0.0, 0.0, 0.0, 1.0), - Margins::new(10.0, 100.0, 10.0, 10.0), - math::vec4(0.0, 1.0, 0.0, 1.0), + Margins::new(10.0, 200.0, 10.0, 10.0), + math::vec4(0.1, 0.1, 0.1, 1.0), + ),)], + ); + + world.insert( + (), + vec![(Node::new( + math::vec2(0.0, 0.0), + Anchors::new(1.0, 1.0, 0.0, 1.0), + Margins::new(10.0, 100.0, 50.0, 100.0), + math::vec4(0.1, 0.1, 0.1, 1.0), ),)], ); @@ -124,4 +134,14 @@ fn setup(world: &mut World) { math::vec4(1.0, 0.5, 0.5, 1.0), ),)], ); + + world.insert( + (), + vec![(Node::new( + math::vec2(150.0, 150.0), + Anchors::new(0.5, 0.5, 0.5, 0.5), + Margins::new(0.0, 100.0, 0.0, 100.0), + math::vec4(1.0, 0.7, 0.7, 1.0), + ),)], + ); } diff --git a/src/app/app_builder.rs b/src/app/app_builder.rs index 2adf3d5dfe..25c6437461 100644 --- a/src/app/app_builder.rs +++ b/src/app/app_builder.rs @@ -84,7 +84,7 @@ impl AppBuilder { pub fn add_default_systems(mut self) -> Self { self.schedule_builder = self .schedule_builder - .add_system(ui::update_system::build_ui_update_system()); + .add_system(ui::ui_update_system::build_ui_update_system()); for transform_system in transform_system_bundle::build(&mut self.world).drain(..) { self.schedule_builder = self.schedule_builder.add_system(transform_system); } diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 627a478e98..f140f12f40 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -1,7 +1,7 @@ mod anchors; mod margins; mod node; -pub mod update_system; +pub mod ui_update_system; pub use anchors::*; pub use margins::*; diff --git a/src/ui/update_system.rs b/src/ui/ui_update_system.rs similarity index 100% rename from src/ui/update_system.rs rename to src/ui/ui_update_system.rs