__init__.py 文件源码

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

项目:spygame 作者: sven1977 项目源码 文件源码
def render(self, display):
        """
        Paints the Sprite with its current image onto the given Display object.

        :param Display display: the Display object to render on (Display has a pygame.Surface, on which we blit our image)
        """
        if self.image:
            #print("render at x={}".format(self.rect.x + self.image_rect.x - display.offsets[0]))
            display.surface.blit(self.image, (self.rect.x + self.image_rect.x - display.offsets[0], self.rect.y + self.image_rect.y - display.offsets[1]))
        if DEBUG_FLAGS & DEBUG_RENDER_SPRITES_RECTS:
            pygame.draw.rect(display.surface, DEBUG_RENDER_SPRITES_RECTS_COLOR,
                             pygame.Rect((self.rect.x - display.offsets[0], self.rect.y - display.offsets[1]),
                                         (self.rect.w, self.rect.h)), 1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号