From: Simon Cross Date: Sun, 28 Feb 2016 20:27:42 +0000 (+0200) Subject: Use buttons on menu screen. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=f9e6be1ad4098911bd3a0d0eed531c83dfd5e720;p=koperkapel.git Use buttons on menu screen. --- 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())]