def set_image(self, image): if image is None: self._cObj.SetImage(None) return if isinstance(image, Bitmap): image = ResourceManager._create_image(image) elif isinstance(image, pygame.Surface): image = ResourceManager._create_image(Bitmap(image)) elif not isinstance(image, ImageInstance): image = ResourceManager.get_image(image) self._image = image self._cObj.SetImage(image._cObj)
def create_single(self, s): surf = self.create_surface(s) img = ResourceManager._create_image(Bitmap(surf)) return Sprite(img)