src/bin/lesson01_window.rs

教程导航 · 代码索引

src/bin/lesson01_window.rs

教程导航 · 代码索引

原文件:Doc/tutorial/src/bin/lesson01_window.rs。

阅读快照 以下内容来自 2026-11-17 导入时的本地源码,后续不会自动同步。编辑、编译和运行请回到原项目;本页 Markdown 不是可直接编译的源文件。

在原项目根目录运行:

cargo run --manifest-path Doc/tutorial/Cargo.toml --bin lesson01_window
use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn(Camera2d);
}