center camera on land
authoralfadur
Fri, 22 Mar 2019 22:26:41 +0300
changeset 14711 40809bfd44af
parent 14710 946df0bb3b28
child 14712 57293f34ce59
child 14714 4df1aac5f090
center camera on land
rust/lib-hedgewars-engine/src/world.rs
--- a/rust/lib-hedgewars-engine/src/world.rs	Fri Mar 22 22:11:53 2019 +0300
+++ b/rust/lib-hedgewars-engine/src/world.rs	Fri Mar 22 22:26:41 2019 +0300
@@ -48,6 +48,8 @@
         use std::path::Path;
 
         if let Some(ref state) = self.game_state {
+            self.camera.position = state.land.play_box().center();
+            
             let theme =
                 Theme::load(Path::new("../../share/hedgewars/Data/Themes/Cheese/")).unwrap();
             let texture = MapGenerator::new().make_texture(&state.land, &theme);