From e16c0e2e3231e4c664199f83b8261aa59e1f426a Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Tue, 28 Oct 2025 16:12:09 -0500 Subject: [PATCH] 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. --- src/main.rs | 1 + www/index.html | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3f8e48b8..f3f134a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ 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() diff --git a/www/index.html b/www/index.html index 03edae38..c9928e09 100644 --- a/www/index.html +++ b/www/index.html @@ -2,6 +2,7 @@ +