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

Fixed unused scale parameter, docstrings.

parent 481c52d9
No related branches found
No related tags found
1 merge request!14Resolve "Cashe loaded gui images"
Pipeline #42245 passed
......@@ -248,17 +248,20 @@ class PyGameGUI:
holding_item_pos = player.pos + (20 * player.facing_direction)
self.draw_item(holding_item_pos, player.holding)
def draw_thing(self, pos: npt.NDArray[float], parts: list[dict[str]], scale=1.0):
def draw_thing(
self, pos: npt.NDArray[float], parts: list[dict[str]], scale: float = 1.0
):
"""Draws an item, based on its visual parts specified in the visualization config.
Args:
pos: Where to draw the item parts.
parts: The visual parts to draw.
scale: Rescale the item by this factor.
"""
for part in parts:
part_type = part["type"]
if part_type == "image":
self.draw_image(parts[0]["path"], parts[0]["size"], pos)
self.draw_image(parts[0]["path"], parts[0]["size"] * scale, pos)
elif part_type == "rect":
height = part["height"]
width = part["width"]
......@@ -296,6 +299,7 @@ class PyGameGUI:
Args:
pos: The position of the item to draw.
item: The item do be drawn in the game.
scale: Rescale the item by this factor.
"""
if not isinstance(item, Meal):
......
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