Difference between revisions of "Text:set"
(Created page) |
(Added colored text variant) |
||
Line 11: | Line 11: | ||
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
+ | |||
+ | == Function == | ||
+ | === Synopsis === | ||
+ | <source lang="lua"> | ||
+ | Text:set( coloredtext ) | ||
+ | </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.}} | ||
+ | === 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. | ||
== Function == | == Function == |
Revision as of 08:11, 24 November 2015
Available since LÖVE 0.10.0 |
This function is not supported in earlier versions. |
Replaces the contents of the Text object with a new unformatted string.
Contents
Function
Synopsis
Text:set( textstring )
Arguments
string textstring
- The new string of text to use.
Returns
Nothing.
Function
Synopsis
Text:set( coloredtext )
Arguments
table coloredtext
- A table containing colors and strings to use as the new text, in the form of
{color1, string1, color2, string2, ...}
.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
{red, green, blue, alpha}
. string string1
- A string of text which has a color specified by the previous color.
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
{red, green, blue, alpha}
. string string2
- A string of text which has a color specified by the previous color.
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.
Function
Clears the contents of the Text object.
Synopsis
Text:set( )
Arguments
None.
Returns
Nothing.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info