#resize #viewport #plugin #bevy-plugin #window #automatic #browser

bevy_web_fullscreen

Bevy plugin for automatic resizing of primary bevy window to fit browser viewport

1 unstable release

0.2.1 Dec 14, 2022

#7 in #viewport

25 downloads per month

MIT license

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)

<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

~25–41MB
~699K SLoC