-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.py
29 lines (25 loc) · 1.01 KB
/
menu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
import sys, pygame, properties, time
class Menu:
screen = None
banner = pygame.image.load("res/abgbanner.png").convert()
bannerrect = banner.get_rect()
blackSurface = pygame.Surface([banner.get_width(), banner.get_height()])
blackSurface.fill([0,0,0])
def __init__(self, screen):
self.screen = screen
def showMenu(self):
inMenu = True
self.screen.blit(self.banner, self.bannerrect)
pygame.display.update(self.bannerrect)
while inMenu:
time.sleep(.1)
pygame.event.pump()
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
self.screen.blit(self.blackSurface, self.bannerrect)
pygame.display.update(self.bannerrect)
inMenu = False
if event.key == pygame.K_ESCAPE:
sys.exit()