增加全屏模式快捷键

This commit is contained in:
星外之神 2022-04-04 13:30:21 +08:00
parent e5dcf0df65
commit 6e14a6ac43
4 changed files with 4 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -80,14 +80,16 @@ class Control():
self.done = True
elif event.type == pg.KEYDOWN:
self.keys = pg.key.get_pressed()
if event.key == pg.K_f:
SCREEN = pg.display.set_mode(c.SCREEN_SIZE, pg.FULLSCREEN)
elif event.key == pg.K_u:
SCREEN = pg.display.set_mode(c.SCREEN_SIZE)
elif event.type == pg.KEYUP:
self.keys = pg.key.get_pressed()
elif event.type == pg.MOUSEBUTTONDOWN:
self.mouse_pos = pg.mouse.get_pos()
self.mouse_click[0], _, self.mouse_click[1] = pg.mouse.get_pressed()
print('pos:', self.mouse_pos, ' mouse:', self.mouse_click)
#else:
# print(pg.event.event_name(event.type))
def run(self):