Skip to content
Snippets Groups Projects
Commit 61eb8c9f authored by fheinrich's avatar fheinrich
Browse files

Second window experimental

parent beea6895
No related branches found
No related tags found
1 merge request!55Resolve "Second window"
Pipeline #45912 passed
...@@ -30,6 +30,8 @@ from overcooked_simulator.utils import ( ...@@ -30,6 +30,8 @@ from overcooked_simulator.utils import (
add_list_of_manager_ids_arguments, add_list_of_manager_ids_arguments,
) )
from pygame._sdl2 import Window, Texture, Image, Renderer, get_drivers, messagebox
class MenuStates(Enum): class MenuStates(Enum):
Start = "Start" Start = "Start"
...@@ -615,7 +617,7 @@ class PyGameGUI: ...@@ -615,7 +617,7 @@ class PyGameGUI:
( (
self.window_width, self.window_width,
self.window_height, self.window_height,
) ),
) )
def reset_window_size(self): def reset_window_size(self):
...@@ -976,6 +978,9 @@ class PyGameGUI: ...@@ -976,6 +978,9 @@ class PyGameGUI:
self.update_selection_elements() self.update_selection_elements()
win = Window("asdf", size=(self.window_width, self.window_height), resizable=True)
renderer = Renderer(win)
# Game loop # Game loop
self.running = True self.running = True
while self.running: while self.running:
...@@ -1080,6 +1085,10 @@ class PyGameGUI: ...@@ -1080,6 +1085,10 @@ class PyGameGUI:
self.main_window.blit(self.game_screen, game_screen_rect) self.main_window.blit(self.game_screen, game_screen_rect)
texture = Texture.from_surface(renderer, self.main_window)
renderer.blit(texture, pygame.Rect(0, 0, self.window_width, self.window_height))
renderer.present()
case MenuStates.End: case MenuStates.End:
self.update_conclusion_label(state) self.update_conclusion_label(state)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment