Warn wasm users about audio not working

This commit is contained in:
Pascal Engélibert 2022-08-27 09:34:21 +02:00
parent e5b041c2c9
commit f3f74f668a
Signed by: tuxmain
GPG key ID: 3504BC6D362F7DCA
2 changed files with 16 additions and 1 deletions

View file

@ -18,7 +18,6 @@
* more audio * more audio
* "jumpable" component to avoid jumping on sensors * "jumpable" component to avoid jumping on sensors
* bug: in level2, move the blue character to win, then reset. The characters are lighter than expected. (also level 4) * bug: in level2, move the blue character to win, then reset. The characters are lighter than expected. (also level 4)
* wasm warning
* redshift warning * redshift warning
* itchio test * itchio test

View file

@ -20,6 +20,22 @@ impl Plugin for MenuPlugin {
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) { fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let font = asset_server.get_handle("UacariLegacy-Thin.ttf"); let font = asset_server.get_handle("UacariLegacy-Thin.ttf");
#[cfg(target_arch = "wasm32")]
commands
.spawn_bundle(Text2dBundle {
text: Text::from_section(
"Note:\nAudio is NOT available in the WASM build.",
TextStyle {
font: font.clone(),
font_size: 24.0,
color: Color::rgba(1., 0.4, 0.4, 1.),
},
)
.with_alignment(TextAlignment::CENTER),
transform: Transform::from_xyz(0., -128.0, 0.),
..Default::default()
})
.insert(Menu);
commands commands
.spawn_bundle(Text2dBundle { .spawn_bundle(Text2dBundle {
text: Text::from_section( text: Text::from_section(