__init__.py 文件源码

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

项目:spygame 作者: sven1977 项目源码 文件源码
def render(self, display):
        """
        Blits a part of our Sprite's image onto the Display's Surface using the Display's offset attributes.

        :param Display display: the Display object to render on
        """
        assert self.do_render, "ERROR: TiledTileLayer.render() called but self.do_render is False!"
        assert not isinstance(self.pygame_sprite, Sprite), "ERROR: TiledTileLayer.render() called but self.pygame_sprite is not a Sprite!"
        r = pygame.Rect(self.pygame_sprite.rect)  # make a clone so we don't change the original Rect
        # apply the display offsets (camera)
        r.x += display.offsets[0]
        r.y += display.offsets[1]
        r.width = display.width
        r.height = display.height
        display.surface.blit(self.pygame_sprite.image, dest=(0, 0), area=r)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号