def load_image(path, transparent):
try: image = pygame.image.load(path)
# Manages error if image cannot be loaded
except (pygame.error) as message:
raise(message)
# Converting to inner pygame format (more efficient)
image = image.convert()
if transparent:
color = image.get_at((0, 0))
image.set_colorkey(color, pygame.RLEACCEL)
return image
# Function to manage texts
评论列表
文章目录