feat(startscreen): add start and quit buttons on startscreen
This commit is contained in:
@@ -7,7 +7,25 @@ class Startscreen:
|
|||||||
self.font_title = pygame.font.SysFont("Arial", 36)
|
self.font_title = pygame.font.SysFont("Arial", 36)
|
||||||
self.font_label = pygame.font.SysFont("Arial", 20)
|
self.font_label = pygame.font.SysFont("Arial", 20)
|
||||||
|
|
||||||
|
self.button_color = (0, 255, 0)
|
||||||
|
self.button_hover_color = (200, 255, 0)
|
||||||
|
|
||||||
# todo buttons must be initialized here
|
# todo buttons must be initialized here
|
||||||
|
self.button_start = Button("[ENTER] Immatrikulieren",
|
||||||
|
500,
|
||||||
|
70,
|
||||||
|
20,
|
||||||
|
60,
|
||||||
|
self.button_color,
|
||||||
|
self.button_hover_color)
|
||||||
|
|
||||||
|
self.button_quit = Button("[ESC] Exmatrikulieren",
|
||||||
|
500,
|
||||||
|
70,
|
||||||
|
20,
|
||||||
|
150,
|
||||||
|
self.button_color,
|
||||||
|
self.button_hover_color)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# set background color
|
# set background color
|
||||||
@@ -19,6 +37,9 @@ class Startscreen:
|
|||||||
message = self.font_label.render("Welcome to FH - Study with purpose", True, (0, 255, 255))
|
message = self.font_label.render("Welcome to FH - Study with purpose", True, (0, 255, 255))
|
||||||
|
|
||||||
# todo buttons must be drawn here
|
# todo buttons must be drawn here
|
||||||
|
button_start_pressed = self.button_start.draw(self.screen)
|
||||||
|
button_start_pressed = self.button_quit.draw(self.screen)
|
||||||
|
|
||||||
# todo check button events/click
|
# todo check button events/click
|
||||||
|
|
||||||
# check key down events - exit/quit
|
# check key down events - exit/quit
|
||||||
|
|||||||
Reference in New Issue
Block a user