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

Corrected center offset when visualizing circles

parent e858735b
No related branches found
No related tags found
1 merge request!25Resolve "Positions based on grid not pixels"
Pipeline #42998 passed
......@@ -341,7 +341,7 @@ class PyGameGUI:
pygame.draw.circle(
self.screen,
color,
(pos * self.grid_size) + np.array(part["center_offset"]),
pos + (np.array(part["center_offset"])*self.grid_size),
radius,
)
else:
......@@ -382,7 +382,6 @@ class PyGameGUI:
def draw_progress_bar(self, pos, current, needed):
"""Visualize progress of progressing item as a green bar under the item."""
if current != 0:
pos = pos * self.grid_size
bar_height = self.grid_size * 0.2
progress_width = (current / needed) * self.grid_size
progress_bar = pygame.Rect(
......
......@@ -176,11 +176,11 @@ ChoppedLettuce:
- type: circle
radius: 0.3
color: black
center_offset: [ -5, 0 ]
center_offset: [ -0.125, 0 ]
- type: circle
radius: 0.25
color: emeraldgreen
center_offset: [ -5, 0 ]
center_offset: [ -0.125, 0 ]
- type: circle
radius: 0.3
color: black
......@@ -190,11 +190,11 @@ ChoppedLettuce:
- type: circle
radius: 0.3
color: black
center_offset: [ 5, 0 ]
center_offset: [ 0.125, 0 ]
- type: circle
radius: 0.25
color: emeraldgreen
center_offset: [ 5, 0 ]
center_offset: [ 0.125, 0 ]
ChoppedTomato:
parts:
......@@ -207,11 +207,11 @@ ChoppedOnion:
- type: circle
radius: 0.3
color: black
center_offset: [ -5, 0 ]
center_offset: [ -0.125, 0 ]
- type: circle
radius: 0.25
color: deeppink4
center_offset: [ -5, 0 ]
center_offset: [ -0.125, 0 ]
- type: circle
radius: 0.3
color: black
......@@ -221,22 +221,22 @@ ChoppedOnion:
- type: circle
radius: 0.3
color: black
center_offset: [ 5, 0 ]
center_offset: [ 0.125, 0 ]
- type: circle
radius: 0.25
color: deeppink4
center_offset: [ 5, 0 ]
center_offset: [ 0.125, 0 ]
ChoppedMeat:
parts:
- type: circle
radius: 0.3
color: black
center_offset: [ -5, 0 ]
center_offset: [ -0.125, 0 ]
- type: circle
radius: 0.25
color: indianred1
center_offset: [ -5, 0 ]
center_offset: [ -0.125, 0 ]
- type: circle
radius: 0.3
color: black
......
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