28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
|
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):
|
||
|
self.back_button = TextLabel('BACK [ESC]', 610, 430, font_size=30)
|
||
|
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()
|