+ def load_image(self, *parts):
+ """Return a pygame surface of the requested image."""
+ fn = self.full_path("images", *parts)
+ img = self._cache.get(fn, None)
+ if img is None:
+ img = pygame.image.load(fn)
+ # We assume pygame.display has been initialised
+ # Fix this if that changes
+ img.convert_alpha(pygame.display.get_surface())
+ self._cache[fn] = img
+ return img
+
+ def load_font(self, *parts, **kwargs):
+ """Return a pygame font of the given size"""
+ size = kwargs.get('size', 12)
+ fn = self.full_path("fonts", *parts)
+ font = pygame.font.Font(fn, size)
+ # Do we need to cache this?
+ return font
+