-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.py
64 lines (51 loc) · 2.14 KB
/
ui.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import pygame
class ClearButton(pygame.sprite.Sprite):
def __init__(self, pos, images):
pygame.sprite.Sprite.__init__(self)
self.image = images["spr_clear_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos
class InfoButton(pygame.sprite.Sprite):
def __init__(self, pos, images):
pygame.sprite.Sprite.__init__(self)
self.image = images["spr_info_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos
class EraserButton(pygame.sprite.Sprite):
def __init__(self, pos, eraser_mode_active, images):
pygame.sprite.Sprite.__init__(self)
self.images = images
self.image = images["spr_eraser_not_selected_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos
def toggle_eraser_button_image(self, eraser_mode_active):
if eraser_mode_active == True:
self.image = self.images["spr_eraser_selected_button"]
else:
self.image = self.images["spr_eraser_not_selected_button"]
class RestartButton(pygame.sprite.Sprite):
def __init__(self, pos, play_sprites, images):
pygame.sprite.Sprite.__init__(self)
self.image = images["spr_restart_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos
play_sprites.add(self)
class GridButton(pygame.sprite.Sprite):
def __init__(self, pos, images):
pygame.sprite.Sprite.__init__(self)
self.image = images["spr_grid_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos
self.grid_on_var = 1
class SaveFileButton(pygame.sprite.Sprite):
def __init__(self, pos, images):
pygame.sprite.Sprite.__init__(self)
self.image = images["spr_save_file_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos
class LoadFileButton(pygame.sprite.Sprite):
def __init__(self, pos, images):
pygame.sprite.Sprite.__init__(self)
self.image = images["spr_load_file_button"]
self.rect = self.image.get_rect()
self.rect.topleft = pos