Compare commits
2 Commits
159a717bd0
...
ccb1c76baf
Author | SHA1 | Date | |
---|---|---|---|
ccb1c76baf | |||
dc0b49ffd7 |
@ -24,6 +24,8 @@ class BaseScreen(EventDispatcher):
|
||||
DR 的 页面API
|
||||
"""
|
||||
|
||||
screen_name: str = 'BaseScreen'
|
||||
|
||||
def __init__(self, main_window: ClientWindow):
|
||||
super().__init__()
|
||||
self.focus = False
|
||||
|
@ -132,11 +132,5 @@ class PressTextButton(widgets.WidgetBase):
|
||||
self.back_rec.height = self._height
|
||||
...
|
||||
|
||||
def on_press(self, x, y):
|
||||
# import random
|
||||
self.value += "1"
|
||||
# next_rgb = [random.randint(50, 255) for _ in range(3)]
|
||||
# self.untouched_color = (*next_rgb, 255)
|
||||
|
||||
|
||||
PressTextButton.register_event_type('on_press')
|
||||
|
24
mods/dr_game/menu.py
Normal file
24
mods/dr_game/menu.py
Normal file
@ -0,0 +1,24 @@
|
||||
# -------------------------------
|
||||
# Difficult Rocket
|
||||
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
|
||||
# All rights reserved
|
||||
# -------------------------------
|
||||
|
||||
from Difficult_Rocket.client import ClientWindow
|
||||
from Difficult_Rocket.api.screen import BaseScreen
|
||||
|
||||
# from . import DR_mod_runtime
|
||||
|
||||
|
||||
class Menu(BaseScreen):
|
||||
"""
|
||||
DR game 的 菜单
|
||||
"""
|
||||
name = 'DR_game_menu'
|
||||
|
||||
def __init__(self,
|
||||
main_window: ClientWindow):
|
||||
super().__init__(main_window)
|
||||
# 占位, 高二看看能不能咕出来点啥 (20230911)
|
||||
# 欸呀, 正好是 911 纪念日哦
|
||||
|
@ -10,7 +10,7 @@ import logging
|
||||
import traceback
|
||||
|
||||
from pathlib import Path
|
||||
from typing import List, TYPE_CHECKING, Dict, Optional, Generator, Tuple
|
||||
from typing import List, Dict, Optional, Generator, Tuple
|
||||
|
||||
from pyglet.gl import gl
|
||||
from pyglet.math import Mat4
|
||||
@ -66,6 +66,8 @@ class SR1ShipRenderStatus(Options): # NOQA
|
||||
class SR1ShipRender(BaseScreen):
|
||||
"""用于渲染 sr1 船的类"""
|
||||
|
||||
screen_name = 'DR_game_sr1_ship_render'
|
||||
|
||||
def __init__(self,
|
||||
main_window: ClientWindow):
|
||||
super().__init__(main_window)
|
||||
@ -281,8 +283,9 @@ class SR1ShipRender(BaseScreen):
|
||||
def draw_batch(self, window: ClientWindow):
|
||||
if self.status.draw_done:
|
||||
self.render_d_label.text = f'x: {self.group_camera.view_x} y: {self.group_camera.view_y}'
|
||||
self.render_d_label.position = self.group_camera.view_x + (self.window_pointer.width / 2), self.group_camera.view_y + (
|
||||
self.window_pointer.height / 2) + 10, 0 # 0 for z
|
||||
self.render_d_label.position = self.group_camera.view_x + (
|
||||
self.window_pointer.width / 2), self.group_camera.view_y + (
|
||||
self.window_pointer.height / 2) + 10, 0 # 0 for z
|
||||
self.render_d_line.x2 = self.group_camera.view_x
|
||||
self.render_d_line.y2 = self.group_camera.view_y
|
||||
|
||||
@ -484,7 +487,6 @@ class SR1ShipRender(BaseScreen):
|
||||
self.window_pointer.view = value
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from objprint import op
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user