// SetFont use bevy::{ prelude::*, ecs::system::EntityCommand }; pub struct SetFont(pub String, pub f32, pub Color); impl EntityCommand for SetFont { fn apply(self, entity: Entity, world: &mut World) { let asset_server = world.resource::(); let font = asset_server.load(&self.0); if let Some(mut text) = world.entity_mut(entity).get_mut::() { for text_section in &mut text.sections { text_section.style.font = font.clone(); text_section.style.font_size = self.1; text_section.style.color = self.2; } } } } // SetPosition pub struct SetPosition(pub f32, pub f32); impl EntityCommand for SetPosition { fn apply(self, entity: Entity, world: &mut World) { // Commands work with direct access to the world. // We can set the position by modifying the style directly: if let Some(mut style) = world.entity_mut(entity).get_mut::