MCPcopy Create free account
hub / github.com/pyscript/pyscript / load_image

Function load_image

core/tests/manual/game/aliens.py:54–62  ·  view source on GitHub ↗

loads an image, prepares it for play

(file)

Source from the content-addressed store, hash-verified

52
53
54def load_image(file):
55 """loads an image, prepares it for play"""
56 file = os.path.join(main_dir, "data", file)
57 try:
58 surface = pygame.image.load(file)
59 except pygame.error:
60 msg = f'Could not load image "{file}" {pygame.get_error()}'
61 raise SystemExit(msg)
62 return surface.convert()
63
64
65def load_sound(file):

Callers 1

mainFunction · 0.85

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected