From f9e6be1ad4098911bd3a0d0eed531c83dfd5e720 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 28 Feb 2016 22:27:42 +0200 Subject: [PATCH] Use buttons on menu screen. --- koperkapel/scenes/menu.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/koperkapel/scenes/menu.py b/koperkapel/scenes/menu.py index dac4402..f2f6ab8 100644 --- a/koperkapel/scenes/menu.py +++ b/koperkapel/scenes/menu.py @@ -1,17 +1,23 @@ """ Main menu scene. """ from pgzero.constants import keys +from ..actors.buttons import TextButton from .base import Scene, ChangeSceneEvent -from .credits import CreditsScene class MenuScene(Scene): """ Main menu scene. """ - def draw(self, screen): - screen.clear() - screen.draw.text("Main menu", (300, 300)) + def __init__(self): + super().__init__() + self._title = self.actors.add(TextButton("Main Menu")) + self._title.pos = (300, 200) + self._level = self.actors.add(TextButton("Level")) + self._level.pos = (300, 300) + self._credits = self.actors.add(TextButton("Credits")) + self._credits.pos = (300, 400) def on_key_down(self, key, mod, unicode): if key == keys.C: + from .credits import CreditsScene return [ChangeSceneEvent(CreditsScene())] -- 2.34.1