MCPcopy Create free account
hub / github.com/bspaans/python-mingus / load_img

Function load_img

mingus_examples/pygame-drum/pygame-drum.py:55–68  ·  view source on GitHub ↗

Load image and return an image object

(name)

Source from the content-addressed store, hash-verified

53
54
55def load_img(name):
56 """Load image and return an image object"""
57
58 fullname = name
59 try:
60 image = pygame.image.load(fullname)
61 if image.get_alpha() is None:
62 image = image.convert()
63 else:
64 image = image.convert_alpha()
65 except pygame.error as message:
66 print("Error: couldn't load image: ", fullname)
67 raise SystemExit(message)
68 return (image, image.get_rect())
69
70
71if not fluidsynth.init(SF2):

Callers 1

pygame-drum.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected