render.py 文件源码

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

项目:project_xcape 作者: OthmanEmpire 项目源码 文件源码
def __init__(self, text, minSize, maxSize, colour, width, height, spacing,
                 x, y):
        """
        :param text: String, the text to render.
        :param minSize: Integer, the minimum size of the font.
        :param maxSize: Integer, the maximum size of the font.
        :param colour: String, the name of the colour to be used.
        :param width: Integer, the width of the output image.
        :param height: Integer, the height of the output image.
        :param spacing: Integer, the spacing between lines in the image.
        :param x: Integer, the x-position of the text.
        :param y: Integer, the y-position of the text.
        """
        lines, font = \
            self.wrap(text, settings.FONT, minSize, maxSize, width, height, spacing)
        image = \
            self.renderLines(lines, font, colour, width, height, spacing)

        self.render = RenderComponent(self)
        self.render.add("background", image)
        self.render.state = "background"
        self.rect = pg.Rect(x, y, 0, 0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号