1 unstable release
0.2.1 | Dec 14, 2022 |
---|
#8 in #viewport
25 downloads per month
5KB
55 lines
bevy_web_fullscreen
plugin for automatic resizing of primary bevy window to fit browser viewport
tested with mrks-its/bevy_webgl2 in ostwilkens/arugio
usage
.add_plugin(FullViewportPlugin)
recommended html/css
<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;
}
Conditional compilation
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);
Dependencies
~24–42MB
~665K SLoC