33 lines
569 B
Python
33 lines
569 B
Python
#!/usr/bin/python3
|
|
|
|
class UI:
|
|
def __init__(self, app):
|
|
self.app = app
|
|
|
|
self.main_menu = MainMenu(app)
|
|
|
|
self.current_page = "main_menu"
|
|
|
|
def draw(self):
|
|
page = getattr(self, self.current_page)
|
|
page.draw()
|
|
|
|
def update(self):
|
|
page = getattr(self, self.current_page)
|
|
page.update()
|
|
|
|
|
|
class Page:
|
|
def __init__(self, app):
|
|
self.app = app
|
|
|
|
def draw(self):
|
|
pass
|
|
|
|
def update(self):
|
|
pass
|
|
|
|
|
|
class MainMenu(Page):
|
|
def draw(self):
|
|
self.app.screen.fill(self.app.blue)
|