⚠️ this plugin is deprecated, as bevy now has this built-in. see link
plugin for automatic resizing of primary bevy window to fit browser viewport
tested with mrks-its/bevy_webgl2 in ostwilkens/arugio
.add_plugin(FullViewportPlugin)
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
body {
margin: 0px;
display: flex;
overflow: hidden;
}
canvas {
touch-action: none;
}
Make use of this cfg in order to have your code only include the plugin when targeting wasm.
#[cfg(target_family = "wasm")]
app.add_plugin(FullViewportPlugin);