From a80bb1e9a13502b68a42412d0931d2edd1721ec0 Mon Sep 17 00:00:00 2001 From: "kaosat.dev" Date: Mon, 4 Mar 2024 10:45:58 +0100 Subject: [PATCH] chore(examples): fixed camera ordering issue when used with bevy_editor_pls --- .../animation/src/game/in_main_menu.rs | 9 ++++++++- .../basic/src/game/in_main_menu.rs | 9 ++++++++- .../basic_xpbd_physics/src/game/in_main_menu.rs | 11 +++++++++-- .../materials/src/game/in_main_menu.rs | 11 +++++++++-- .../src/game/in_main_menu.rs | 11 +++++++++-- .../basic/src/game/in_main_menu.rs | 11 +++++++++-- .../basic/src/game/in_main_menu.rs | 9 ++++++++- 7 files changed, 60 insertions(+), 11 deletions(-) diff --git a/examples/bevy_gltf_blueprints/animation/src/game/in_main_menu.rs b/examples/bevy_gltf_blueprints/animation/src/game/in_main_menu.rs index 32142cd..eda1fd1 100644 --- a/examples/bevy_gltf_blueprints/animation/src/game/in_main_menu.rs +++ b/examples/bevy_gltf_blueprints/animation/src/game/in_main_menu.rs @@ -2,7 +2,14 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); commands.spawn(( TextBundle::from_section( diff --git a/examples/bevy_gltf_blueprints/basic/src/game/in_main_menu.rs b/examples/bevy_gltf_blueprints/basic/src/game/in_main_menu.rs index 5a32955..106e1e8 100644 --- a/examples/bevy_gltf_blueprints/basic/src/game/in_main_menu.rs +++ b/examples/bevy_gltf_blueprints/basic/src/game/in_main_menu.rs @@ -2,7 +2,14 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); commands.spawn(( TextBundle::from_section( diff --git a/examples/bevy_gltf_blueprints/basic_xpbd_physics/src/game/in_main_menu.rs b/examples/bevy_gltf_blueprints/basic_xpbd_physics/src/game/in_main_menu.rs index 32142cd..b1925eb 100644 --- a/examples/bevy_gltf_blueprints/basic_xpbd_physics/src/game/in_main_menu.rs +++ b/examples/bevy_gltf_blueprints/basic_xpbd_physics/src/game/in_main_menu.rs @@ -2,8 +2,15 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); - + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); + commands.spawn(( TextBundle::from_section( "SOME GAME TITLE !!", diff --git a/examples/bevy_gltf_blueprints/materials/src/game/in_main_menu.rs b/examples/bevy_gltf_blueprints/materials/src/game/in_main_menu.rs index 32142cd..b1925eb 100644 --- a/examples/bevy_gltf_blueprints/materials/src/game/in_main_menu.rs +++ b/examples/bevy_gltf_blueprints/materials/src/game/in_main_menu.rs @@ -2,8 +2,15 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); - + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); + commands.spawn(( TextBundle::from_section( "SOME GAME TITLE !!", diff --git a/examples/bevy_gltf_blueprints/multiple_levels_multiple_blendfiles/src/game/in_main_menu.rs b/examples/bevy_gltf_blueprints/multiple_levels_multiple_blendfiles/src/game/in_main_menu.rs index 32142cd..b1925eb 100644 --- a/examples/bevy_gltf_blueprints/multiple_levels_multiple_blendfiles/src/game/in_main_menu.rs +++ b/examples/bevy_gltf_blueprints/multiple_levels_multiple_blendfiles/src/game/in_main_menu.rs @@ -2,8 +2,15 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); - + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); + commands.spawn(( TextBundle::from_section( "SOME GAME TITLE !!", diff --git a/examples/bevy_gltf_save_load/basic/src/game/in_main_menu.rs b/examples/bevy_gltf_save_load/basic/src/game/in_main_menu.rs index caf8829..746257d 100644 --- a/examples/bevy_gltf_save_load/basic/src/game/in_main_menu.rs +++ b/examples/bevy_gltf_save_load/basic/src/game/in_main_menu.rs @@ -2,8 +2,15 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); - + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); + commands.spawn(( TextBundle::from_section( "SOME GAME TITLE !!", diff --git a/examples/bevy_registry_export/basic/src/game/in_main_menu.rs b/examples/bevy_registry_export/basic/src/game/in_main_menu.rs index 32142cd..eda1fd1 100644 --- a/examples/bevy_registry_export/basic/src/game/in_main_menu.rs +++ b/examples/bevy_registry_export/basic/src/game/in_main_menu.rs @@ -2,7 +2,14 @@ use bevy::prelude::*; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; pub fn setup_main_menu(mut commands: Commands) { - commands.spawn((Camera2dBundle::default(), InMainMenu)); + commands.spawn(( + Camera2dBundle{ + camera: Camera { + order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 + ..default() + }, + ..Default::default() + }, InMainMenu)); commands.spawn(( TextBundle::from_section(