diff --git a/cooperative_cuisine/pygame_2d_vis/gui.py b/cooperative_cuisine/pygame_2d_vis/gui.py index c74bf0f4f62d16530b383b631c375b75e394c84e..8d3b49c5638436aab0d7f9f625680eebe8a96fe6 100644 --- a/cooperative_cuisine/pygame_2d_vis/gui.py +++ b/cooperative_cuisine/pygame_2d_vis/gui.py @@ -173,7 +173,6 @@ class PyGameGUI: self.FPS = self.visualization_config["GameWindow"]["FPS"] - self.screen_margin = self.visualization_config["GameWindow"]["screen_margin"] self.min_width = self.visualization_config["GameWindow"]["min_width"] self.min_height = self.visualization_config["GameWindow"]["min_height"] self.buttons_width = self.visualization_config["GameWindow"]["buttons_width"] @@ -428,6 +427,9 @@ class PyGameGUI: self.window_width = self.window_width_windowed self.window_height = self.window_height_windowed + self.screen_margin = self.visualization_config["GameWindow"][ + "screen_margin_proportion" + ] * min(self.window_width, self.window_height) self.main_window = pygame.display.set_mode( ( self.window_width, @@ -1330,7 +1332,7 @@ class PyGameGUI: self.vis.draw_orders( screen=self.orders_image.image, state=state, - grid_size=self.buttons_height, + grid_size=self.screen_margin * 0.68, width=self.orders_container_width, height=self.screen_margin, config=self.visualization_config, @@ -1434,21 +1436,21 @@ class PyGameGUI: duration_color_change = 90 if score > self.last_score: self.score_label.update_theming( - '{"colours": {"normal_text": "#03b706"}, "font": { "size": 22, "bold": 1}}' + '{"colours": {"normal_text": "#03b706"}, "font": { "size": 20, "bold": 1}}' ) self.count_frames_score_label = 0 self.switch_score_color = True elif score < self.last_score: self.score_label.update_theming( - '{"colours": {"normal_text": "#e22312"}, "font": { "size": 22, "bold": 1}}' + '{"colours": {"normal_text": "#e22312"}, "font": { "size": 20, "bold": 1}}' ) self.count_frames_score_label = 0 self.switch_score_color = True elif self.switch_score_color: if self.count_frames_score_label >= duration_color_change: self.score_label.update_theming( - '{"colours": {"normal_text": "#000000"}, "font": { "size": 20, "bold": 0}}' + '{"colours": {"normal_text": "#000000"}, "font": { "size": 20, "bold": 1}}' ) self.count_frames_score_label = 0 self.switch_score_color = False diff --git a/cooperative_cuisine/pygame_2d_vis/visualization.yaml b/cooperative_cuisine/pygame_2d_vis/visualization.yaml index 6f1fbe54331287555d4c9e25f4e2fd1bdf4fdb41..6cccb65b0358f4d6d6191ada7e67340ff0bb8e7b 100644 --- a/cooperative_cuisine/pygame_2d_vis/visualization.yaml +++ b/cooperative_cuisine/pygame_2d_vis/visualization.yaml @@ -7,7 +7,7 @@ Gui: show_counter_centers: False GameWindow: - screen_margin: 100 + screen_margin_proportion: 0.15 min_width: 900 min_height: 600 buttons_width: 180