rename ui_update_system

This commit is contained in:
Carter Anderson 2020-01-12 18:00:58 -08:00
parent 6da891be29
commit 875b7492c8
5 changed files with 24 additions and 5 deletions

View file

@ -183,7 +183,6 @@ fn build_print_status_system() -> Box<dyn Schedulable> {
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: {}",

View file

@ -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),
),)],
);
}

View file

@ -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);
}

View file

@ -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::*;