txt.py 文件源码

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

项目:solarwolf 作者: pygame 项目源码 文件源码
def text(self, color, text, center=None, pos='center', bgd=(0,0,0)):
        if text is None: text = ' '
        try:
            if gfx.surface.get_bytesize()>1:
                img = self.font.render(text, 1, color, bgd)
                img.set_colorkey(bgd, pygame.RLEACCEL)
            else:
                img = self.font.render(text, 0, color)
        except (pygame.error, TypeError):
            img = pygame.Surface((10, 10))
        img = img.convert()
        r = self._positionrect(img, center, pos)
        return [img, r]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号