def draw(self, surface):
surface.blit(self.surface, self.rect)
+
+
+class PreRenderedImageBox(Widget):
+ """Hold an image given as a surface"""
+
+ def __init__(self, pos, image):
+ super(PreRenderedImageBox, self).__init__(pos)
+ self.surface = image.copy()
+
+ def prepare(self):
+ self.size = self.surface.get_rect().size
+
+ def draw(self, surface):
+ surface.blit(self.surface, self.rect)
+