up you go
This commit is contained in:
parent
6b05d87828
commit
54194f6927
@ -307,6 +307,21 @@ class SR1ShipRender(BaseScreen):
|
||||
SR1ShipRender_Option.debug_mouse_d_pos = not SR1ShipRender_Option.debug_mouse_d_pos
|
||||
self.debug_mouse_delta_line.visible = SR1ShipRender_Option.debug_mouse_d_pos
|
||||
# print('sr1 mouse')
|
||||
elif command.re_match('get_buf'):
|
||||
import pyglet
|
||||
|
||||
def screenshot(window):
|
||||
from libs.pyglet.gl.gl import GLubyte, GL_RGBA, GL_UNSIGNED_BYTE, glReadPixels
|
||||
width = window.width
|
||||
height = window.height
|
||||
format_str = "RGBA"
|
||||
buf = (GLubyte * (len(format_str) * width * height))()
|
||||
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buf)
|
||||
# print(buf)
|
||||
return pyglet.image.ImageData(width, height, format_str, buf)
|
||||
|
||||
image_data = screenshot(self.window_pointer)
|
||||
image_data.save('test.png')
|
||||
|
||||
def on_mouse_drag(self, x: int, y: int, dx: int, dy: int, buttons: int, modifiers: int):
|
||||
if not self.focus:
|
||||
|
@ -17,6 +17,13 @@
|
||||
- [![Readme-gitee](https://img.shields.io/badge/Readme-中文(点我!)-blue.svg?style=flat-square)](../../README.md)
|
||||
- Using [SemVer 2.0.0](https://semver.org/) to manage version
|
||||
|
||||
## 2023 V 0.7.0.3
|
||||
|
||||
### 命令
|
||||
|
||||
- `get_buf`
|
||||
- 用于截屏 并将文件保存至根目录下面的 `test.png`
|
||||
|
||||
## 20230207 V 0.7.0.2
|
||||
|
||||
淦, 忘记步进版本号了(
|
||||
|
Loading…
Reference in New Issue
Block a user