Difference between revisions of "TextField:setText"

From GiderosMobile
 
(2 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Sets the text to be displayed.
 
Sets the text to be displayed.
Gideros accepts special escape sequences within the text to modify rendering, in the form of \e[key1=value1,key2=value2,...]. Value can be omitted (and the equal sign too in this case), in which case the effect specified by the key is reset to its default value.<br />
+
<syntaxhighlight lang="lua">
 +
TextField:setText(text)
 +
</syntaxhighlight>
 +
 
 +
Gideros accepts special escape sequences within the text to modify rendering, in the form of \e[key1=value1,key2=value2,...].
 +
 
 +
Value can be omitted (and the equal sign too in this case), in which case the effect specified by the key is reset to its default value.
 +
 
 
Accepted keys are:
 
Accepted keys are:
* color: Set the color of the next characters, in the form #rgb, #rgba, #rrggbb or #rrggbbaa
+
* color: sets the color of the next characters, in the form #rgb, #rgba, #rrggbb or #rrggbbaa
* font: Specify the font to use, relevant if the font is a [[CompositeFont]]
+
* font: specifies the font to use, relevant if the font is a [[CompositeFont]]
 
 
<source lang="lua">
 
TextField:setText(text)
 
</source>
 
  
 
=== Parameters ===
 
=== Parameters ===

Latest revision as of 08:18, 18 October 2024

Available since: Gideros 2011.6
Class: TextField

Description

Sets the text to be displayed.

TextField:setText(text)

Gideros accepts special escape sequences within the text to modify rendering, in the form of \e[key1=value1,key2=value2,...].

Value can be omitted (and the equal sign too in this case), in which case the effect specified by the key is reset to its default value.

Accepted keys are:

  • color: sets the color of the next characters, in the form #rgb, #rgba, #rrggbb or #rrggbbaa
  • font: specifies the font to use, relevant if the font is a CompositeFont

Parameters

text: (string) the text to be displayed