Mesh:setTextureCoordinate: Difference between revisions
From GiderosMobile
No edit summary |
removed language stuff |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Available since:''' Gideros 2012.09<br/> | |||
''' | '''Class:''' [[Mesh]]<br/> | ||
''' | |||
=== | === Description === | ||
Sets a texture coordinate at texture coordinate array. | |||
Sets a texture coordinate at texture coordinate array. | |||
<source lang="lua"> | <source lang="lua"> | ||
Mesh:setTextureCoordinate(i,u,v) | |||
</source> | </source> | ||
=== | |||
'''i''': (number) | Indices start from 1. If the texture coordinate array is not large enough, it is automatically expanded. | ||
'''u''': (number) | |||
'''v''': (number) | === Parameters === | ||
=== | '''i''': (number) index<br/> | ||
''' | '''u''': (number) u coordinate<br/> | ||
<source lang="lua">-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100) | '''v''': (number) v coordinate<br/> | ||
=== Example === | |||
'''Setting a texture coordinate''' | |||
<source lang="lua"> | |||
-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100) | |||
mesh:setTextureCoordinate(1, 0, 0) | mesh:setTextureCoordinate(1, 0, 0) | ||
mesh:setTextureCoordinate(2, 100, 0) | mesh:setTextureCoordinate(2, 100, 0) | ||
mesh:setTextureCoordinate(3, 0, 100)</source> | mesh:setTextureCoordinate(3, 0, 100) | ||
</source> | |||
{{Mesh}} | {{Mesh}} | ||
Revision as of 02:54, 19 March 2021
Available since: Gideros 2012.09
Class: Mesh
Description
Sets a texture coordinate at texture coordinate array.
Mesh:setTextureCoordinate(i,u,v)
Indices start from 1. If the texture coordinate array is not large enough, it is automatically expanded.
Parameters
i: (number) index
u: (number) u coordinate
v: (number) v coordinate
Example
Setting a texture coordinate
-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100)
mesh:setTextureCoordinate(1, 0, 0)
mesh:setTextureCoordinate(2, 100, 0)
mesh:setTextureCoordinate(3, 0, 100)
- 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: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
- Mesh:updateBones