add readme info

This commit is contained in:
shenjack 2023-08-12 20:20:18 +08:00
parent 82111be30b
commit e888ddfdad
Signed by: shenjack
GPG Key ID: 7B1134A979775551
4 changed files with 18 additions and 6 deletions

View File

@ -11,6 +11,8 @@
## 请注意 这个仓库未来只会发布 `DR SDK` 的更新 `DR game` 的更新会在 [这里](https://github.com/shenjackyuanjie/DR-game) 发布 ## 请注意 这个仓库未来只会发布 `DR SDK` 的更新 `DR game` 的更新会在 [这里](https://github.com/shenjackyuanjie/DR-game) 发布
![demo](docs/src/demo.png)
<a href="https://996.icu"><img src="https://img.shields.io/badge/link-996.icu-red.svg" alt="996.icu" /></a> <a href="https://996.icu"><img src="https://img.shields.io/badge/link-996.icu-red.svg" alt="996.icu" /></a>
[![Generic badge](https://img.shields.io/badge/SemVer-2.0.0-blue.svg)](https://Semver.org/) [![Generic badge](https://img.shields.io/badge/SemVer-2.0.0-blue.svg)](https://Semver.org/)
[![Generic badge](https://img.shields.io/badge/编写于_Python_版本-3.8.10-blue.svg)](https://Python.org) [![Generic badge](https://img.shields.io/badge/编写于_Python_版本-3.8.10-blue.svg)](https://Python.org)

View File

@ -9,6 +9,8 @@
## Notice: This repo will only publish `DR SDK` updates, `DR game` updates will be published [here](https://github.com/shenjackyuanjie/DR-game) ## Notice: This repo will only publish `DR SDK` updates, `DR game` updates will be published [here](https://github.com/shenjackyuanjie/DR-game)
![demo](/src/demo.png)
<a href="https://996.icu"><img src="https://img.shields.io/badge/link-996.icu-red.svg" alt="996.icu" /></a> <a href="https://996.icu"><img src="https://img.shields.io/badge/link-996.icu-red.svg" alt="996.icu" /></a>
[![Generic badge](https://img.shields.io/badge/SemVer-2.0.0-blue.svg)](https://Semver.org/) [![Generic badge](https://img.shields.io/badge/SemVer-2.0.0-blue.svg)](https://Semver.org/)
[![Generic badge](https://img.shields.io/badge/Write_with_Python-3.8.10-blue.svg)](https://Python.org) [![Generic badge](https://img.shields.io/badge/Write_with_Python-3.8.10-blue.svg)](https://Python.org)

BIN
docs/src/demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 KiB

View File

@ -12,7 +12,7 @@ import traceback
from pathlib import Path from pathlib import Path
from typing import List, TYPE_CHECKING, Dict, Optional, Generator, Tuple from typing import List, TYPE_CHECKING, Dict, Optional, Generator, Tuple
from pyglet.math import Vec4 from pyglet.math import Vec4, Mat4
from pyglet.text import Label from pyglet.text import Label
from pyglet.sprite import Sprite from pyglet.sprite import Sprite
from pyglet.graphics import Batch, Group from pyglet.graphics import Batch, Group
@ -73,14 +73,14 @@ class SR1ShipRender(BaseScreen):
self.dx = 0 self.dx = 0
self.dy = 0 self.dy = 0
self.width = main_window.width - 100 self.width = main_window.width
self.height = main_window.height - 100 self.height = main_window.height
self.buffer = Framebuffer() self.buffer = Framebuffer()
self.render_texture = Texture.create(self.width, self.height) self.render_texture = Texture.create(self.width, self.height)
self.buffer.attach_texture(self.render_texture) self.buffer.attach_texture(self.render_texture)
self.main_batch = Batch() self.main_batch = Batch()
self.group_camera = CenterGroupCamera(window=main_window, self.group_camera = CenterGroupCamera(window=self,
order=10, order=10,
parent=main_window.main_group, parent=main_window.main_group,
min_zoom=(1 / 2) ** 10, min_zoom=(1 / 2) ** 10,
@ -314,8 +314,8 @@ class SR1ShipRender(BaseScreen):
if not self.status.draw_done: if not self.status.draw_done:
return return
if self.status.focus: if self.status.focus:
mouse_dx = x - (window.width / 2) mouse_dx = x - (self.width / 2) + self.dx
mouse_dy = y - (window.height / 2) mouse_dy = y - (self.height / 2) + self.dy
# 鼠标缩放位置相对于屏幕中心的位置 # 鼠标缩放位置相对于屏幕中心的位置
mouse_dx_d = mouse_dx - self.group_camera.view_x mouse_dx_d = mouse_dx - self.group_camera.view_x
mouse_dy_d = mouse_dy - self.group_camera.view_y mouse_dy_d = mouse_dy - self.group_camera.view_y
@ -468,6 +468,14 @@ class SR1ShipRender(BaseScreen):
# break # break
# self.render_ship() # self.render_ship()
@property
def view(self):
return self.window_pointer.view
@view.setter
def view(self, value: Mat4):
self.window_pointer.view = value
if __name__ == '__main__': if __name__ == '__main__':
from objprint import op from objprint import op