예제 #1
0
 def crop(cls, image, area):
     '''
     Return the cropped portion of an image.
     '''
     new_surface = pygame.surface.Surface((area.width, area.height),
                                          flags=SRCALPHA)
     new_surface.blit(image, (0,0), area)
     return image.subsurface(area).copy()
예제 #2
0
 def __init__(self,image):
     self.scr = display.get_surface()
     w,h = image.get_size()
     w //= 3
     self.images = [image.subsurface(x,0,w,h).copy() for x in range(0,w*3,w)]
     Rect.__init__(self,0,0,w,h)
     self.ACTIV = True
     self.status = False
     self.over = False
예제 #3
0
 def __init__(self, image):
     self.scr = display.get_surface()
     w, h = image.get_size()
     w //= 3
     self.images = [
         image.subsurface(x, 0, w, h).copy() for x in range(0, w * 3, w)
     ]
     Rect.__init__(self, 0, 0, w, h)
     self.ACTIV = True
     self.status = False
     self.over = False