Skip to content
Snippets Groups Projects
Commit 05af345c authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Screen margin relative to window size, order size dependent on screen_margin

parent 952f18b3
No related branches found
No related tags found
No related merge requests found
Pipeline #49667 passed
...@@ -173,7 +173,6 @@ class PyGameGUI: ...@@ -173,7 +173,6 @@ class PyGameGUI:
self.FPS = self.visualization_config["GameWindow"]["FPS"] 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_width = self.visualization_config["GameWindow"]["min_width"]
self.min_height = self.visualization_config["GameWindow"]["min_height"] self.min_height = self.visualization_config["GameWindow"]["min_height"]
self.buttons_width = self.visualization_config["GameWindow"]["buttons_width"] self.buttons_width = self.visualization_config["GameWindow"]["buttons_width"]
...@@ -428,6 +427,9 @@ class PyGameGUI: ...@@ -428,6 +427,9 @@ class PyGameGUI:
self.window_width = self.window_width_windowed self.window_width = self.window_width_windowed
self.window_height = self.window_height_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.main_window = pygame.display.set_mode(
( (
self.window_width, self.window_width,
...@@ -1330,7 +1332,7 @@ class PyGameGUI: ...@@ -1330,7 +1332,7 @@ class PyGameGUI:
self.vis.draw_orders( self.vis.draw_orders(
screen=self.orders_image.image, screen=self.orders_image.image,
state=state, state=state,
grid_size=self.buttons_height, grid_size=self.screen_margin * 0.68,
width=self.orders_container_width, width=self.orders_container_width,
height=self.screen_margin, height=self.screen_margin,
config=self.visualization_config, config=self.visualization_config,
...@@ -1434,21 +1436,21 @@ class PyGameGUI: ...@@ -1434,21 +1436,21 @@ class PyGameGUI:
duration_color_change = 90 duration_color_change = 90
if score > self.last_score: if score > self.last_score:
self.score_label.update_theming( 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.count_frames_score_label = 0
self.switch_score_color = True self.switch_score_color = True
elif score < self.last_score: elif score < self.last_score:
self.score_label.update_theming( 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.count_frames_score_label = 0
self.switch_score_color = True self.switch_score_color = True
elif self.switch_score_color: elif self.switch_score_color:
if self.count_frames_score_label >= duration_color_change: if self.count_frames_score_label >= duration_color_change:
self.score_label.update_theming( 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.count_frames_score_label = 0
self.switch_score_color = False self.switch_score_color = False
......
...@@ -7,7 +7,7 @@ Gui: ...@@ -7,7 +7,7 @@ Gui:
show_counter_centers: False show_counter_centers: False
GameWindow: GameWindow:
screen_margin: 100 screen_margin_proportion: 0.15
min_width: 900 min_width: 900
min_height: 600 min_height: 600
buttons_width: 180 buttons_width: 180
......
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