Files
another-boids-in-rust/src/main.rs
Robert Garrett e16c0e2e32 Add and use a custom canvas element on the page
Tell bevy to find the canvas with ID "#boids-canvas" instead of creating
it's own.
2025-10-28 16:12:09 -05:00

24 lines
572 B
Rust

use bevy::prelude::*;
mod birdoids;
mod debug_plugin;
use birdoids::BoidsPlugin;
use debug_plugin::BoidsDebugPlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
canvas: Some("#boids-canvas".to_owned()),
fit_canvas_to_parent: true,
prevent_default_event_handling: false,
..default()
}),
..default()
}))
.add_plugins(BoidsDebugPlugin)
.add_plugins(BoidsPlugin)
.run();
}