use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.insert_resource(WindowDescriptor{
width: 140.0,
height:140.0,
title: "Game of Life".to_string(),
..Default::default()
})
.run();
}
Run Code Online (Sandbox Code Playgroud)
我不知道为什么这不起作用并且显示以下编译错误
error[E0277]: the trait bound `bevy::prelude::WindowDescriptor: Resource` is not satisfied
--> src\main.rs:7:26
|
7 | .insert_resource(WindowDescriptor{
| __________---------------_^
| | |
| | required by a bound introduced by this call
8 | | width: 140.0,
9 | | height:140.0,
10 | | title: "Game of Life".to_string(),
11 | | ..Default::default()
12 | | })
| |_________^ the trait `Resource` is …Run Code Online (Sandbox Code Playgroud)