Difference between revisions of "Mesh:setColors"

From GiderosMobile
Line 8: Line 8:
 
  Mesh:setColors(colors)
 
  Mesh:setColors(colors)
 
</source>
 
</source>
'''colors''': (any)  ''''''<br/>
+
=== Parameters ===
 +
'''colors''': (any)  <br/>
 +
=== Examples ===
 +
'''Example'''<br/>
 +
<source lang="lua">-- set 3 colors with seperate function calls<br />
 +
mesh:setColor(1, 0xff0000, 0.5)<br />
 +
mesh:setColor(2, 0x00ff00, 0.7)<br />
 +
mesh:setColor(3, 0x0000ff)<br />
 +
<br />
 +
-- set 3 colors with one function call<br />
 +
mesh:setColors(1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0)<br />
 +
<br />
 +
-- same as above<br />
 +
mesh:setColors{1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0}<br />
 +
<br />
 +
-- these two functions do nothing<br />
 +
mesh:setColors()<br />
 +
mesh:setColors{}<br /></source>

Revision as of 10:36, 23 August 2018

Available since: Gideros 2012.09

Description


Sets zero or more colors at color array with a single function call. It accepts multiple values or a Lua array.

 Mesh:setColors(colors)

Parameters

colors: (any)

Examples

Example

-- set 3 colors with seperate function calls<br />
mesh:setColor(1, 0xff0000, 0.5)<br />
mesh:setColor(2, 0x00ff00, 0.7)<br />
mesh:setColor(3, 0x0000ff)<br />
<br />
-- set 3 colors with one function call<br />
mesh:setColors(1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0)<br />
<br />
-- same as above<br />
mesh:setColors{1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0}<br />
<br />
-- these two functions do nothing<br />
mesh:setColors()<br />
mesh:setColors{}<br />