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)
评论列表
文章目录