Skip to content

Commit

Permalink
Remove the bit about DefaultPlugins being equivalent to...
Browse files Browse the repository at this point in the history
Decided to remove it entirely, instead of updating it because:

- DefaultPlugins contains so many things the information isn't really helpful
- so that we don't have to worry about it going outdated again.
- so noobs don't think they should inline it
  • Loading branch information
SIGSTACKFAULT authored Oct 15, 2023
1 parent 6aa0faa commit 877c8c0
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions content/learn/book/getting-started/plugins/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ You should hopefully notice two things:
* **A window should pop up**. This is because we now have {{rust_type(type="struct" crate="bevy_window" name="WindowPlugin")}}, which defines the window interface (but doesn't actually know how to make windows), and {{rust_type(type="struct" crate="bevy_winit" name="WinitPlugin")}} which uses the [winit library](https://github.com/rust-windowing/winit) to create a window using your OS's native window API.
* **Your console is now full of "hello" messages**: This is because {{rust_type(type="struct" crate="bevy" name="DefaultPlugins")}} adds an "event loop" to our application. Our App's ECS Schedule now runs in a loop once per "frame". We will resolve the console spam in a moment.

Note that `add_plugins(DefaultPlugins)` is equivalent to the following:

```rs
fn main() {
App::new()
.add_plugins((
CorePlugin::default(),
InputPlugin::default(),
WindowPlugin::default(),
/* more plugins omitted for brevity */
))
.run();
}
```

You are free to use whatever approach suits you!

## Creating your first plugin

For better organization, let's move all of our "hello" logic to a plugin. To create a plugin we just need to implement the {{rust_type(type="trait" name="Plugin" crate="bevy_app" no_mod=true)}} interface. Add the following code to your `main.rs` file:
Expand Down

0 comments on commit 877c8c0

Please sign in to comment.