vid.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:CritterEvolution 作者: apockill 项目源码 文件源码
def setimage(self,ishape):
        """Set the image of the Sprite.

        Arguments:
            ishape -- an image, or an image, rectstyle.  The rectstyle will
                      describe the shape of the image, used for collision detection.

        """        
        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.shape = shape
        self.rect.w,self.rect.h = shape.w,shape.h
        self.irect.w,self.irect.h = image.get_width(),image.get_height()
        self.updated = 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号