更新一下camera_rs的小细节
This commit is contained in:
parent
242c2ca9a7
commit
d104074549
@ -25,7 +25,7 @@ from libs.MCDR.version import Version
|
|||||||
|
|
||||||
game_version = Version("0.7.0.0") # 游戏版本
|
game_version = Version("0.7.0.0") # 游戏版本
|
||||||
build_version = Version("1.1.0.0") # 编译文件版本(与游戏本体无关)
|
build_version = Version("1.1.0.0") # 编译文件版本(与游戏本体无关)
|
||||||
DR_rust_version = Version("0.1.7.0") # DR 的 Rust 编写部分的版本
|
DR_rust_version = Version("0.1.8.0") # DR 的 Rust 编写部分的版本
|
||||||
__version__ = game_version
|
__version__ = game_version
|
||||||
|
|
||||||
long_version: int = 12
|
long_version: int = 12
|
||||||
|
@ -283,8 +283,8 @@ class SR1ShipRender(BaseScreen):
|
|||||||
def on_mouse_drag(self, x: int, y: int, dx: int, dy: int, buttons: int, modifiers: int):
|
def on_mouse_drag(self, x: int, y: int, dx: int, dy: int, buttons: int, modifiers: int):
|
||||||
if not self.focus:
|
if not self.focus:
|
||||||
return
|
return
|
||||||
self.camera_rs.dx += dx
|
self.camera_rs.dx += dx / self.camera_rs.zoom
|
||||||
self.camera_rs.dy += dy
|
self.camera_rs.dy += dy / self.camera_rs.zoom
|
||||||
self.need_update_parts = True
|
self.need_update_parts = True
|
||||||
# self.update_parts()
|
# self.update_parts()
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
Set-Location .\libs\Difficult_Rocket_rs\src
|
Set-Location .\libs\Difficult_Rocket_rs\src
|
||||||
|
|
||||||
python3.8 setup.py build
|
python3.8 setup.py build
|
||||||
|
python3.9 setup.py build
|
||||||
|
python3.11 setup.py build
|
||||||
|
|
||||||
python3.8 after_build.py
|
python3.8 after_build.py
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ use pyo3::prelude::*;
|
|||||||
|
|
||||||
#[pyfunction]
|
#[pyfunction]
|
||||||
fn get_version_str() -> String {
|
fn get_version_str() -> String {
|
||||||
return String::from("0.1.7.0");
|
return String::from("0.1.8.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[pyfunction]
|
#[pyfunction]
|
||||||
|
@ -72,8 +72,8 @@ pub mod camera {
|
|||||||
|
|
||||||
let x: f64 = self.window.getattr(py, intern!(py, "width"))?.extract(py)?;
|
let x: f64 = self.window.getattr(py, intern!(py, "width"))?.extract(py)?;
|
||||||
let y: f64 = self.window.getattr(py, intern!(py, "height"))?.extract(py)?;
|
let y: f64 = self.window.getattr(py, intern!(py, "height"))?.extract(py)?;
|
||||||
let x: f64 = x / 2.0 / self.zoom + (self.dx / self.zoom);
|
let x: f64 = x / 2.0 / self.zoom + self.dx;
|
||||||
let y: f64 = y / 2.0 / self.zoom + (self.dy / self.zoom);
|
let y: f64 = y / 2.0 / self.zoom + self.dy;
|
||||||
|
|
||||||
let args = ((x * self.zoom, y * self.zoom, 0), );
|
let args = ((x * self.zoom, y * self.zoom, 0), );
|
||||||
let view_matrix = view.call_method1(py, intern!(py, "translate"), args)?;
|
let view_matrix = view.call_method1(py, intern!(py, "translate"), args)?;
|
||||||
@ -93,8 +93,8 @@ pub mod camera {
|
|||||||
|
|
||||||
let x: f64 = self.window.getattr(py, intern!(py, "width"))?.extract(py)?;
|
let x: f64 = self.window.getattr(py, intern!(py, "width"))?.extract(py)?;
|
||||||
let y: f64 = self.window.getattr(py, intern!(py, "height"))?.extract(py)?;
|
let y: f64 = self.window.getattr(py, intern!(py, "height"))?.extract(py)?;
|
||||||
let x: f64 = x / 2.0 / self.zoom + (self.dx / self.zoom);
|
let x: f64 = x / 2.0 / self.zoom + self.dx;
|
||||||
let y: f64 = y / 2.0 / self.zoom + (self.dy / self.zoom);
|
let y: f64 = y / 2.0 / self.zoom + self.dy;
|
||||||
|
|
||||||
let args = ((1.0 / self.zoom, 1.0 / self.zoom, 1), );
|
let args = ((1.0 / self.zoom, 1.0 / self.zoom, 1), );
|
||||||
let view_matrix = view.call_method1(py, intern!(py, "scale"), args)?;
|
let view_matrix = view.call_method1(py, intern!(py, "scale"), args)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user