use bevy::prelude::*; fn main() { App::build() .add_default_plugins() .add_startup_system(setup) .run(); } fn setup(world: &mut World, resources: &mut Resources) { let mut textures = resources.get_mut::>().unwrap(); let texture_path = concat!(env!("CARGO_MANIFEST_DIR"), "/assets/branding/icon.png"); let texture = Texture::load(TextureType::Png(texture_path.to_string())); let texture_handle = textures.add(texture); let mut color_materials = resources.get_mut::>().unwrap(); world .build() .add_entity(Camera2dEntity::default()) .add_entity(SpriteEntity { rect: Rect { position: Vec2::new(300.0, 300.0), z_index: 0.5, ..Default::default() }, material: color_materials.add(texture_handle.into()), ..Default::default() }); }