Difference between revisions of "Mesh:setColors"

From GiderosMobile
(clarification?)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2012.09<br/>
'''<translate>Available since</translate>:''' Gideros 2012.09<br/>
+
'''Class:''' [[Mesh]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Mesh|Mesh]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
Sets zero or more colors to a mesh with a single function call.
Sets zero or more colors at color array with a single function call. It accepts multiple values or a Lua array.<br />
 
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
Mesh:setColors(colors)
+
Mesh:setColors(colors)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''colors''': (any) <translate></translate> <br/>
+
=== Parameters ===
=== <translate>Examples</translate> ===
+
'''colors''': (any) multiple values or a Lua array<br/>
'''Example'''<br/>
+
 
<source lang="lua">-- set 3 colors with seperate function calls
+
=== Example ===
 +
'''Different setColor function calls'''
 +
<source lang="lua">
 +
-- sets 3 colors with seperate function calls
 
mesh:setColor(1, 0xff0000, 0.5)
 
mesh:setColor(1, 0xff0000, 0.5)
 
mesh:setColor(2, 0x00ff00, 0.7)
 
mesh:setColor(2, 0x00ff00, 0.7)
 
mesh:setColor(3, 0x0000ff)
 
mesh:setColor(3, 0x0000ff)
  
-- set 3 colors with one function call
+
-- sets 3 colors with one function call
 
mesh:setColors(1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0)
 
mesh:setColors(1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0)
  
Line 27: Line 28:
 
-- these two functions do nothing
 
-- these two functions do nothing
 
mesh:setColors()
 
mesh:setColors()
mesh:setColors{}</source>
+
mesh:setColors{}
 +
</source>
  
 
{{Mesh}}
 
{{Mesh}}

Revision as of 19:21, 14 March 2021

Available since: Gideros 2012.09
Class: Mesh

Description

Sets zero or more colors to a mesh with a single function call.

Mesh:setColors(colors)

Parameters

colors: (any) multiple values or a Lua array

Example

Different setColor function calls

-- sets 3 colors with seperate function calls
mesh:setColor(1, 0xff0000, 0.5)
mesh:setColor(2, 0x00ff00, 0.7)
mesh:setColor(3, 0x0000ff)

-- sets 3 colors with one function call
mesh:setColors(1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0)

-- same as above
mesh:setColors{1, 0xff0000, 0.5, 2, 0x00ff00, 0.7, 3, 0x0000ff, 1.0}

-- these two functions do nothing
mesh:setColors()
mesh:setColors{}