From fb5209a5c26f5d73031059be3988830041d0b4e0 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Thu, 30 Oct 2025 12:00:09 -0500 Subject: [PATCH] Have Bevy find assigned canvas element Bevy creates it's own canvas element by default, but the custom page defines its own. This makes Bevy go find that one. The window sizing still works -- it simply resizes the canvas upon starting. I'm not sure if I'll change that or remove the size from the HTML. That's a tomorrow problem. --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 1b11da6..4dcd02a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,7 @@ fn main() { App::new() .add_plugins(DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { + canvas: Some("#game-canvas".to_owned()), resolution: WindowResolution::new(WINDOW_SIZE.x, WINDOW_SIZE.y), ..default() }),