def create_tools(self, gamestate):
tools = []
+ y = SCREEN_SIZE[1] - 40
tools.append(ImageButton(
- '32', 'pause.png', name='pause play', pos=(SCREEN_SIZE[0] - 150, SCREEN_SIZE[1] - 40)))
+ '32', 'pause.png', name='pause play', pos=(SCREEN_SIZE[0] - 150, y)))
+ tools.append(ImageButton(
+ '32', 'exit.png', name='exit', pos=(SCREEN_SIZE[0] - 50, y)))
return tools
@debug_timer("night.render")
if tool.pressed(ev):
if tool.name == 'pause play':
self.toggle_pause()
+ elif tool.name == 'exit':
+ from .menu import MenuScene
+ SceneChangeEvent.post(scene=MenuScene())
def toggle_pause(self):
self._paused = not self._paused