File tree Expand file tree Collapse file tree 2 files changed +31
-14
lines changed Expand file tree Collapse file tree 2 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -43,23 +43,26 @@ fn main() {
43
43
. run ( ) ;
44
44
}
45
45
46
+ #[ expect(
47
+ missing_docs,
48
+ reason = "This is a simple marker struct and does not require documentation."
49
+ ) ]
46
50
pub struct MainPlugin ;
47
51
48
52
impl Plugin for MainPlugin {
49
53
fn build ( & self , app : & mut App ) {
50
- app
51
- . insert_resource ( WinitSettings :: mobile ( ) )
52
- . add_systems ( Startup , ( setup_scene, setup_music) )
53
- . add_systems (
54
- Update ,
55
- (
56
- touch_camera,
57
- button_handler,
58
- // Only run the lifetime handler when an [`AudioSink`] component exists in the world.
59
- // This ensures we don't try to manage audio that hasn't been initialized yet.
60
- handle_lifetime. run_if ( any_with_component :: < AudioSink > ) ,
61
- ) ,
62
- ) ;
54
+ app. insert_resource ( WinitSettings :: mobile ( ) )
55
+ . add_systems ( Startup , ( setup_scene, setup_music) )
56
+ . add_systems (
57
+ Update ,
58
+ (
59
+ touch_camera,
60
+ button_handler,
61
+ // Only run the lifetime handler when an [`AudioSink`] component exists in the world.
62
+ // This ensures we don't try to manage audio that hasn't been initialized yet.
63
+ handle_lifetime. run_if ( any_with_component :: < AudioSink > ) ,
64
+ ) ,
65
+ ) ;
63
66
}
64
67
}
65
68
@@ -209,4 +212,3 @@ fn handle_lifetime(
209
212
}
210
213
}
211
214
}
212
-
Original file line number Diff line number Diff line change
1
+ //! # Mobile Example (Desktop Entry Point)
2
+ //!
3
+ //! This is the desktop entry point for a Bevy application designed to simulate
4
+ //! a mobile environment. It runs on a PC but uses a mobile-like window resolution
5
+ //! (360x640) for development and testing purposes.
6
+ //!
7
+ //! ## Features:
8
+ //! - Uses `DefaultPlugins` with a custom `AssetPlugin` to load assets from a specific directory.
9
+ //! - Configures the primary window to start in a 360x640 resolution (portrait mode).
10
+ //! - Implements a system to toggle the window orientation between portrait and landscape using the keyboard.
11
+ //!
12
+ //! ## Controls:
13
+ //! - Press `L` to switch to landscape mode (640x360).
14
+ //! - Press `P` to switch back to portrait mode (360x640).
15
+
1
16
use bevy:: prelude:: * ;
2
17
use bevy:: window:: { PrimaryWindow , WindowResolution } ;
3
18
You can’t perform that action at this time.
0 commit comments