use super::{Collisions, Emitter}; use amethyst::assets::Loader; use amethyst::core::{Parent, Time}; use amethyst::ecs::prelude::{Builder, Entity, Join, World}; use amethyst::ui::{Anchor, TtfFormat, UiText, UiTransform}; use amethyst::utils::fps_counter::FPSCounter; pub fn create_ui(world: &mut World) -> (Entity, Entity, Entity) { let font = world.read_resource::().load( "examples/resources/font/square.ttf", TtfFormat, (), (), &world.read_resource(), ); let num_display = world .create_entity() .with(UiTransform::new( "num".to_string(), Anchor::TopLeft, 100., 25., 1., 200., 50., 0, )).with(UiText::new( font.clone(), "N/A".to_string(), [1.0, 1.0, 1.0, 1.0], 25., )).build(); let fps_display = world .create_entity() .with(UiTransform::new( "fps".to_string(), Anchor::BottomLeft, 100., 0., 1., 200., 50., 0, )).with(UiText::new( font.clone(), "N/A".to_string(), [1.0, 1.0, 1.0, 1.0], 25., )).with(Parent { entity: num_display, }).build(); let collisions_display = world .create_entity() .with(UiTransform::new( "collisions".to_string(), Anchor::BottomLeft, 100., 0., 1., 200., 50., 0, )).with(UiText::new( font.clone(), "N/A".to_string(), [1.0, 1.0, 1.0, 1.0], 25., )).with(Parent { entity: fps_display, }).build(); (num_display, fps_display, collisions_display) } pub fn update_ui

( world: &mut World, num_entity: Entity, fps_entity: Entity, collision_entity: Entity, ) where P: Send + Sync + 'static, { let frame_number = world.read_resource::