bevy_web_fullscreen

Crates.iobevy_web_fullscreen
lib.rsbevy_web_fullscreen
version0.2.1
sourcesrc
created_at2022-12-14 23:43:23.367744
updated_at2022-12-14 23:43:23.367744
descriptionBevy plugin for automatic resizing of primary bevy window to fit browser viewport
homepage
repository
max_upload_size
id737205
size5,687
Carl Öst Wilkens (ostwilkens)

documentation

README

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);
Commit count: 0

cargo fmt