Difference between revisions of "Mesh:setColorArray"

From GiderosMobile
Line 8: Line 8:
 
  Mesh:setColorArray(colors)
 
  Mesh:setColorArray(colors)
 
</source>
 
</source>
'''colors''': (any)  ''''''<br/>
+
=== Parameters ===
 +
'''colors''': (any)  <br/>
 +
=== Examples ===
 +
'''Example'''<br/>
 +
<source lang="lua">-- set the color array as (0xff0000, 0.5), (0x00ff00, 0.7) and (0x0000ff, 1.0).<br />
 +
mesh:setColorArray(0xff0000, 0.5, 0x00ff00, 0.7, 0x0000ff, 1.0)<br />
 +
<br />
 +
-- same as above<br />
 +
mesh:setColorArray{0xff0000, 0.5, 0x00ff00, 0.7, 0x0000ff, 1.0}<br /></source>

Revision as of 11:37, 23 August 2018

Available since: Gideros 2012.09

Description


Assigns new content to the color array, dropping all the elements contained in the color array before the call and replacing them by those specified by the parameters. It accepts multiple values or a Lua array.

 Mesh:setColorArray(colors)

Parameters

colors: (any)

Examples

Example

-- set the color array as (0xff0000, 0.5), (0x00ff00, 0.7) and (0x0000ff, 1.0).<br />
mesh:setColorArray(0xff0000, 0.5, 0x00ff00, 0.7, 0x0000ff, 1.0)<br />
<br />
-- same as above<br />
mesh:setColorArray{0xff0000, 0.5, 0x00ff00, 0.7, 0x0000ff, 1.0}<br />