Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Merge requests
!14
Resolve "Cashe loaded gui images"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Cashe loaded gui images"
46-cashe-loaded-gui-images
into
main
Overview
0
Commits
3
Pipelines
4
Changes
1
Merged
Fabian Heinrich
requested to merge
46-cashe-loaded-gui-images
into
main
1 year ago
Overview
0
Commits
3
Pipelines
4
Changes
1
Expand
Closes
#46 (closed)
0
0
Merge request reports
Viewing commit
a88a6b49
Prev
Next
Show latest version
1 file
+
6
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
a88a6b49
Fixed unused scale parameter, docstrings.
· a88a6b49
Fabian Heinrich
authored
1 year ago
overcooked_simulator/pygame_gui/pygame_gui.py
+
6
−
2
Options
@@ -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
):
Loading