def __init__(self,ishape,pos):
if not isinstance(ishape, tuple):
ishape = ishape,None
image,shape = ishape
if shape == None:
shape = pygame.Rect(0,0,image.get_width(),image.get_height())
if isinstance(shape, tuple): shape = pygame.Rect(shape)
self.image = image
self._image = self.image
self.shape = shape
self.rect = pygame.Rect(pos[0],pos[1],shape.w,shape.h)
self._rect = pygame.Rect(self.rect)
self.irect = pygame.Rect(pos[0]-self.shape.x,pos[1]-self.shape.y,
image.get_width(),image.get_height())
self._irect = pygame.Rect(self.irect)
self.groups = 0
self.agroups = 0
self.updated = 1
评论列表
文章目录