diff --git a/Difficult_Rocket/client/render/sr1_ship.py b/Difficult_Rocket/client/render/sr1_ship.py index 51ba893..3b10d82 100644 --- a/Difficult_Rocket/client/render/sr1_ship.py +++ b/Difficult_Rocket/client/render/sr1_ship.py @@ -155,8 +155,8 @@ class SR1ShipRender(BaseScreen): # render_scale = DR_option.gui_scale # 这个是 DR 的缩放比例 可以调节的( # 主要是 Windows 下有一个缩放系数嘛,我待会试试这玩意能不能获取(估计得 ctypes # 在不缩放的情况下,XML的1个单位长度对应60个像素 - render_x = part.x * 60 + self.window_pointer.width / 2 - render_y = part.y * 60 + self.window_pointer.height / 2 + render_x = part.x * 60 + render_y = part.y * 60 # 你就这里改吧 cache_sprite = Sprite(img=self.textures.get_texture(part.textures), x=render_x, y=render_y, diff --git a/libs/Difficult_Rocket_rs/src/src/render.rs b/libs/Difficult_Rocket_rs/src/src/render.rs index 1393e7c..2e6ec61 100644 --- a/libs/Difficult_Rocket_rs/src/src/render.rs +++ b/libs/Difficult_Rocket_rs/src/src/render.rs @@ -74,14 +74,18 @@ pub mod camera { let y: f64 = self.window.getattr(py, intern!(py, "height"))?.extract(py)?; let x: f64 = x / 2.0 / self.zoom + self.dx; let y: f64 = y / 2.0 / self.zoom + self.dy; + // use to get center of the screen let args = ((x * self.zoom, y * self.zoom, 0), ); let view_matrix = view.call_method1(py, intern!(py, "translate"), args)?; + // view_matrix = self.view.translate((x * zoom, y * zoom, 0)) let args = ((self.zoom, self.zoom, 1), ); let view_matrix = view_matrix.call_method1(py, intern!(py, "scale"), args)?; + // view_matrix = view_matrix.scale((zoom, zoom, 1)) self.window.setattr(py, intern!(py, "view"), view_matrix)?; + // self.view = view_matrix Ok(()) })?; return Ok(())