-
Notifications
You must be signed in to change notification settings - Fork 0
/
endscreen.py
30 lines (25 loc) · 916 Bytes
/
endscreen.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
30
import gui
import pygame
from quit import *
from game import *
from gui.dialog import *
from gui.image import *
class EndScreen(Dialog):
def __init__(self, surface, images, locations, player):
self.images = images
self.locations = locations
self.player = player
Dialog.__init__(self, surface)
def createWidgets(self):
self.wm.register(Image(self.images['endscreen']['winner'+str(self.player)],
(int(self.locations['endscreen']['winner_x']),
int(self.locations['endscreen']['winner_y']))
))
self.wm.register(Button(self.images['endscreen']['return'], self.images['endscreen']['return'],
(int(self.locations['endscreen']['return_x']),
int(self.locations['endscreen']['return_y'])),
callbacks={widget.MOUSEBUTTONUP : self.return_to_main }
))
def return_to_main(self, trigger, event):
self.state = 1
return widget.DONE