animation.py 文件源码

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

项目:jackit 作者: vix597 项目源码 文件源码
def image_at(self, rect, colorkey=None, x_mirror=False, y_mirror=False, rotation=0):
        '''
        Load image at rect
        '''
        rect = pygame.Rect(rect)
        image = pygame.Surface(rect.size).convert()
        image.blit(self.sheet, (0, 0), rect)

        if x_mirror or y_mirror:
            image = pygame.transform.flip(image, x_mirror, y_mirror)
        if rotation > 0:
            image = pygame.transform.rotate(image, rotation)

        # Determine the color key after transforms. Fix for weird graphics issue
        # in pygame_sdl2 refs #62
        if colorkey is not None:
            if colorkey is -1:
                colorkey = image.get_at((0, 0))
            image.set_colorkey(colorkey, pygame.RLEACCEL)

        return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号