Difference between revisions of "Mesh:setColors"
From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | ''' | + | '''Available since:''' Gideros 2012.09<br/> |
− | ''' | + | '''Class:''' [[Mesh]]<br/> |
− | === | + | |
− | + | === Description === | |
− | Sets zero or more colors | + | Sets zero or more colors to a mesh with a single function call. |
− | + | <syntaxhighlight lang="lua"> | |
− | < | + | Mesh:setColors(colors) |
− | + | </syntaxhighlight> | |
− | </ | + | |
− | === | + | === Parameters === |
− | '''colors''': (any) | + | '''colors''': (any) multiple values or a Lua array<br/> |
− | === | + | |
− | ''' | + | === Example === |
− | < | + | '''Different setColor function calls''' |
+ | <syntaxhighlight 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) | ||
− | -- | + | -- 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 26: | Line 28: | ||
-- these two functions do nothing | -- these two functions do nothing | ||
mesh:setColors() | mesh:setColors() | ||
− | mesh:setColors{}</ | + | mesh:setColors{} |
+ | </syntaxhighlight> | ||
+ | |||
+ | {{Mesh}} |
Latest revision as of 14:30, 13 July 2023
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{}
- Mesh
- Mesh.new
- Mesh:clearColorArray
- Mesh:clearIndexArray
- Mesh:clearTexture
- Mesh:clearTextureCoordinateArray
- Mesh:clearVertexArray
- Mesh:getColor
- Mesh:getColorArraySize
- Mesh:getIndex
- Mesh:getIndexArraySize
- Mesh:getTextureCoordinate
- Mesh:getTextureCoordinateArraySize
- Mesh:getVertex
- Mesh:getVertexArraySize
- Mesh:resizeColorArray
- Mesh:resizeIndexArray
- Mesh:resizeTextureCoordinateArray
- Mesh:resizeVertexArray
- Mesh:setAutoSort
- Mesh:setColor
- Mesh:setColorArray
- Mesh:setColors
- Mesh:setCullMode
- Mesh:setGenericArray
- Mesh:setIndex
- Mesh:setIndexArray
- Mesh:setIndices
- Mesh:setInstanceCount
- Mesh:setPrimitiveType
- Mesh:setTexture
- Mesh:setTextureCoordinate
- Mesh:setTextureCoordinateArray
- Mesh:setTextureCoordinates
- Mesh:setVertex
- Mesh:setVertexArray
- Mesh:setVertices