{{newin|[[0.10.0]]|100|type=function}}
Replaces the contents of the Text object with a new formatted string.

== Function ==
=== Synopsis ===
<source lang="lua">
Text:setf( textstring, wraplimit, alignmode )
</source>
=== Arguments ===
{{param|string|textstring|The new string of text to use.}}
{{param|number|wraplimit|The maximum width in pixels of the text before it gets automatically wrapped to a new line.}}
{{param|AlignMode|align|The alignment of the text.}}
=== Returns ===
Nothing.

== Function ==
=== Synopsis ===
<source lang="lua">
Text:setf( coloredtext, wraplimit, alignmode )
</source>
=== Arguments ===
{{param|table|coloredtext|A table containing colors and strings to use as the new text, in the form of <code>{color1, string1, color2, string2, ...}</code>.}}
{{subparam|table|color1|A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of <code>{red, green, blue, alpha}</code>.}}
{{subparam|string|string1|A string of text which has a color specified by the previous color.}}
{{subparam|table|color2|A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of <code>{red, green, blue, alpha}</code>.}}
{{subparam|string|string2|A string of text which has a color specified by the previous color.}}
{{subparam|tables and strings|...|Additional colors and strings.}}
{{param|number|wraplimit|The maximum width in pixels of the text before it gets automatically wrapped to a new line.}}
{{param|AlignMode|align|The alignment of the text.}}
=== Returns ===
Nothing.
=== Notes ===
The color set by [[love.graphics.setColor]] will be combined (multiplied) with the colors of the text, when drawing the Text object.

== See Also ==
* [[parent::Text]]
* [[Text:set]]
* [[Text:add]]
* [[Text:addf]]
* [[Text:clear]]
[[Category:Functions]]
{{#set:Description=Replaces the contents of the Text object with a new formatted string.}}
== Other Languages ==
{{i18n|Text:setf}}