我想在 python 中制作一个可视计时器,但找不到任何图形库,所以我使用街机来完成这项工作,但我认为有些东西我没有得到。
到目前为止我所拥有的:
import time
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Program test")
arcade.set_background_color(arcade.color.WHITE)
arcade.start_render()
mid_x = SCREEN_WIDTH/2
mid_y = SCREEN_HEIGHT/2
def cur_time(self):
arcade.draw_text(str(c_tim),start_x,start_y,arcade.color.BLACK)
def sc(self):
arcade.draw_rectangle_filled(mid_y,mid_y,600,600,arcade.color.BLACK)
arcade.draw_rectangle_filled(mid_y,mid_y,600,600,arcade.color.WHITE)
start_x = 100
start_y = 100
c_tim = 10
while True:
cur_time
time.sleep(1)
sc
arcade.get_projection()
arcade.finish_render()
arcade.run()