Difference between revisions of "TextField:setTextColor"

From GiderosMobile
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[TextField]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/TextField|TextField]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
Sets the color of the text in a TextField in hexadecimal format or the new Luau type for colors ''ColorValue'' (Gideros 2024.11+).
<br />
+
<syntaxhighlight lang="lua">
Sets the color of the text in a text field in hexadecimal format.<br />
+
TextField:setTextColor(color)
<br />
+
</syntaxhighlight>
<br /></translate>
+
 
<source lang="lua">
+
=== Parameters ===
TextField:setTextColor(color)
+
'''color''': (number) color of the text in hexadecimal format<br/>
</source>
+
 
=== <translate>Parameters</translate> ===
+
=== Examples ===
'''color''': (number) <translate>color of the text in hexadecimal format.</translate> <br/>
+
<syntaxhighlight lang="lua">
=== <translate>Examples</translate> ===
+
textfield:setTextColor(0xff0000) -- red
'''Example'''<br/>
 
<source lang="lua">textfield:setTextColor(0xff0000) -- red
 
 
textfield:setTextColor(0x00ff00) -- green
 
textfield:setTextColor(0x00ff00) -- green
textfield:setTextColor(0x0000ff) -- blue</source>
+
textfield:setTextColor(0x0000ff) -- blue
 +
 
 +
-- Gideros 2024.11+ (r, g, b, a)
 +
textfield:setTextColor(ColorValue(0, 1, 0, 1)) -- green
 +
</syntaxhighlight>
 +
 
 +
{{TextField}}

Latest revision as of 22:07, 6 November 2024

Available since: Gideros 2011.6
Class: TextField

Description

Sets the color of the text in a TextField in hexadecimal format or the new Luau type for colors ColorValue (Gideros 2024.11+).

TextField:setTextColor(color)

Parameters

color: (number) color of the text in hexadecimal format

Examples

textfield:setTextColor(0xff0000)	-- red
textfield:setTextColor(0x00ff00)	-- green
textfield:setTextColor(0x0000ff)	-- blue

-- Gideros 2024.11+ (r, g, b, a)
textfield:setTextColor(ColorValue(0, 1, 0, 1)) -- green