diff --git a/docs/chapters/add_player_sprite.md b/docs/chapters/add_player_sprite.md index 65a7096..137be6d 100644 --- a/docs/chapters/add_player_sprite.md +++ b/docs/chapters/add_player_sprite.md @@ -304,7 +304,7 @@ fn main() { let initial_player_size = Vec2::new(64.0, 32.0); let mut app = create_app(initial_player_position, initial_player_size); let add_camera_fn = |mut commands: Commands| { - commands.spawn(Camera2d::default()); + commands.spawn(Camera2d); }; app.add_systems(Startup, add_camera_fn); app.add_plugins(DefaultPlugins); diff --git a/docs/chapters/add_player_sprite_with_texture.md b/docs/chapters/add_player_sprite_with_texture.md index f6ca4fc..eded6c3 100644 --- a/docs/chapters/add_player_sprite_with_texture.md +++ b/docs/chapters/add_player_sprite_with_texture.md @@ -160,7 +160,7 @@ pub fn create_app() -> App { if cfg!(test) { app.add_plugins(AssetPlugin::default()); app.add_plugins(TaskPoolPlugin::default()); - app.init_asset::(); + app.init_asset::(); } app.add_systems(Startup, add_player); diff --git a/docs/chapters/add_text.md b/docs/chapters/add_text.md index 259d841..69033a2 100644 --- a/docs/chapters/add_text.md +++ b/docs/chapters/add_text.md @@ -194,7 +194,7 @@ fn main() { let text = String::from("Hello from main"); let mut app = create_app(text); let add_camera_fn = |mut commands: Commands| { - commands.spawn(Camera2d::default()); + commands.spawn(Camera2d); }; app.add_systems(Startup, add_camera_fn); app.add_plugins(DefaultPlugins); diff --git a/docs/chapters/move_player.md b/docs/chapters/move_player.md index db5f67a..cdd7ef1 100644 --- a/docs/chapters/move_player.md +++ b/docs/chapters/move_player.md @@ -269,7 +269,7 @@ fn main() { let velocity = Vec2::new(0.2, 0.1); let mut app = create_app(velocity); let add_camera_fn = |mut commands: Commands| { - commands.spawn(Camera2d::default()); + commands.spawn(Camera2d); }; app.add_systems(Startup, add_camera_fn); app.add_plugins(DefaultPlugins); diff --git a/docs/chapters/move_player_with_keyboard.md b/docs/chapters/move_player_with_keyboard.md index 3f2745e..2d44a85 100644 --- a/docs/chapters/move_player_with_keyboard.md +++ b/docs/chapters/move_player_with_keyboard.md @@ -26,7 +26,7 @@ This chapter introduces: fn main() { let mut app = create_app(); let add_camera_fn = |mut commands: Commands| { - commands.spawn(Camera2d::default()); + commands.spawn(Camera2d); }; app.add_systems(Startup, add_camera_fn); diff --git a/docs/chapters/move_player_with_mouse.md b/docs/chapters/move_player_with_mouse.md index ce0b2a9..34bd24e 100644 --- a/docs/chapters/move_player_with_mouse.md +++ b/docs/chapters/move_player_with_mouse.md @@ -143,7 +143,7 @@ fn test_player_responds_to_mouse_wheel_turn() { fn main() { let mut app = create_app(); let add_camera_fn = |mut commands: Commands| { - commands.spawn(Camera2d::default()); + commands.spawn(Camera2d); }; app.add_systems(Startup, add_camera_fn); app.add_plugins(DefaultPlugins); diff --git a/docs/chapters/respond_to_window_resize.md b/docs/chapters/respond_to_window_resize.md index 8eaafe0..e529a46 100644 --- a/docs/chapters/respond_to_window_resize.md +++ b/docs/chapters/respond_to_window_resize.md @@ -92,12 +92,12 @@ Results in: ```rust fn respond_to_window_resize( - mut q: Query<&mut Text>, + mut q: Query<&mut Text2d>, mut resize_reader: EventReader, ) { let mut text = q.single_mut(); for e in resize_reader.read() { - text.sections[0].value = format!("{:.1} x {:.1}", e.width, e.height); + text.0 = format!("{:.1} x {:.1}", e.width, e.height); } } ```