mirror of
https://github.com/bevyengine/bevy
synced 2024-11-13 00:17:27 +00:00
ebcdc9fb8c
system params can be in any order, faster compiles, remove foreach
22 lines
546 B
Rust
22 lines
546 B
Rust
use bevy::prelude::*;
|
|
|
|
fn main() {
|
|
App::build()
|
|
.add_plugins(DefaultPlugins)
|
|
.add_startup_system(setup.system())
|
|
.run();
|
|
}
|
|
|
|
fn setup(
|
|
commands: &mut Commands,
|
|
asset_server: Res<AssetServer>,
|
|
mut materials: ResMut<Assets<ColorMaterial>>,
|
|
) {
|
|
let texture_handle = asset_server.load("branding/icon.png");
|
|
commands
|
|
.spawn(Camera2dComponents::default())
|
|
.spawn(SpriteComponents {
|
|
material: materials.add(texture_handle.into()),
|
|
..Default::default()
|
|
});
|
|
}
|