@@ -4,12 +4,14 @@ use bevy::prelude::*;
44
55fn main ( ) {
66 App :: new ( )
7- . insert_resource ( WindowDescriptor {
8- width : 1350.0 ,
9- height : 700.0 ,
7+ . add_plugins ( DefaultPlugins . set ( WindowPlugin {
8+ window : WindowDescriptor {
9+ width : 1350.0 ,
10+ height : 700.0 ,
11+ ..default ( )
12+ } ,
1013 ..default ( )
11- } )
12- . add_plugins ( DefaultPlugins )
14+ } ) )
1315 . add_startup_system ( setup)
1416 . run ( ) ;
1517}
@@ -21,7 +23,7 @@ fn spawn_sprites(
2123 slice_border : f32 ,
2224) {
2325 // Reference sprite
24- commands. spawn_bundle ( SpriteBundle {
26+ commands. spawn ( SpriteBundle {
2527 transform : Transform :: from_translation ( base_pos) ,
2628 texture : texture_handle. clone ( ) ,
2729 sprite : Sprite {
@@ -32,7 +34,7 @@ fn spawn_sprites(
3234 } ) ;
3335
3436 // Scaled regular sprite
35- commands. spawn_bundle ( SpriteBundle {
37+ commands. spawn ( SpriteBundle {
3638 transform : Transform :: from_translation ( base_pos + Vec3 :: X * 150.0 ) ,
3739 texture : texture_handle. clone ( ) ,
3840 sprite : Sprite {
@@ -43,7 +45,7 @@ fn spawn_sprites(
4345 } ) ;
4446
4547 // Stretched Scaled sliced sprite
46- commands. spawn_bundle ( SpriteBundle {
48+ commands. spawn ( SpriteBundle {
4749 transform : Transform :: from_translation ( base_pos + Vec3 :: X * 300.0 ) ,
4850 texture : texture_handle. clone ( ) ,
4951 sprite : Sprite {
@@ -59,7 +61,7 @@ fn spawn_sprites(
5961 } ) ;
6062
6163 // Scaled sliced sprite
62- commands. spawn_bundle ( SpriteBundle {
64+ commands. spawn ( SpriteBundle {
6365 transform : Transform :: from_translation ( base_pos + Vec3 :: X * 450.0 ) ,
6466 texture : texture_handle. clone ( ) ,
6567 sprite : Sprite {
@@ -76,7 +78,7 @@ fn spawn_sprites(
7678 } ) ;
7779
7880 // Scaled sliced sprite horizontally
79- commands. spawn_bundle ( SpriteBundle {
81+ commands. spawn ( SpriteBundle {
8082 transform : Transform :: from_translation ( base_pos + Vec3 :: X * 700.0 ) ,
8183 texture : texture_handle. clone ( ) ,
8284 sprite : Sprite {
@@ -93,7 +95,7 @@ fn spawn_sprites(
9395 } ) ;
9496
9597 // Scaled sliced sprite horizontally with max scale
96- commands. spawn_bundle ( SpriteBundle {
98+ commands. spawn ( SpriteBundle {
9799 transform : Transform :: from_translation ( base_pos + Vec3 :: X * 1050.0 ) ,
98100 texture : texture_handle,
99101 sprite : Sprite {
@@ -111,7 +113,7 @@ fn spawn_sprites(
111113}
112114
113115fn setup ( mut commands : Commands , asset_server : Res < AssetServer > ) {
114- commands. spawn_bundle ( Camera2dBundle :: default ( ) ) ;
116+ commands. spawn ( Camera2dBundle :: default ( ) ) ;
115117 // Load textures
116118 let handle_1 = asset_server. load ( "textures/slice_square.png" ) ;
117119 let handle_2 = asset_server. load ( "textures/slice_square_2.png" ) ;
0 commit comments