sep-pm-platformer/project/level/selection/WinScreenManager.py

28 lines
1.1 KiB
Python
Raw Permalink Normal View History

2023-03-29 18:07:52 +02:00
from abc import abstractmethod
from level.selection.ScreenManager import ScreenManager
from physics.SpriteManager import SpriteManager, DrawLayers
from physics.TickData import TickData
from sprite.SpritesheetManager import SpritesheetManager
from ui_elements import CoordinateTransform
from ui_elements.TextLabel import TextLabel
from ui_elements.ClickEvent import ClickEvent
class WinScreenManager(ScreenManager):
def __init__(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, main_loop):
super().__init__(sprite_manager, spritesheet_manager, main_loop)
def go_to_menu(self, click):
if click.is_click_down(ClickEvent.CLICK_LEFT):
self.main_loop.select_level_selection()
def initialize(self):
2023-03-29 18:26:34 +02:00
self.back_button = TextLabel('BACK', 610, 430, font_size=30)
2023-03-29 18:07:52 +02:00
self.back_button.position_scale.scale = (0.5, 0.5)
self.add_element(DrawLayers.UI, self.back_button)
self.back_button.add_click_listener(lambda click: self.go_to_menu(click))
def destroy(self):
super().destroy()