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.
21 lines
676 B
Rust
21 lines
676 B
Rust
use bevy::{prelude::*, window::WindowResolution};
|
|
|
|
use asteroids::{AsteroidPlugin, config::WINDOW_SIZE};
|
|
use bevy_inspector_egui::{bevy_egui::EguiPlugin, quick::WorldInspectorPlugin};
|
|
|
|
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()
|
|
}),
|
|
..default()
|
|
}))
|
|
.add_plugins(AsteroidPlugin)
|
|
.add_plugins(EguiPlugin::default())
|
|
.add_plugins(WorldInspectorPlugin::new())
|
|
.run();
|
|
}
|