Mesh:setTextureCoordinate: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2012.09<br/>
'''<translate>Available since</translate>:''' Gideros 2012.09<br/>
=== Description ===
=== <translate>Description</translate> ===
<translate><br />
<translate><br />
Sets a texture coordinate at texture coordinate array. Indices are start from 1. If the texture coordinate array is not large enough, it&#039;s expanded automatically.<br />
Sets a texture coordinate at texture coordinate array. Indices are start from 1. If the texture coordinate array is not large enough, it&#039;s expanded automatically.<br />
Line 8: Line 8:
  Mesh:setTextureCoordinate(i,u,v)
  Mesh:setTextureCoordinate(i,u,v)
</source>
</source>
=== Parameters ===
=== <translate>Parameters</translate> ===
'''i''': (number) <translate>index</translate> <br/>
'''i''': (number) <translate>index</translate> <br/>
'''u''': (number) <translate>u coordinate</translate> <br/>
'''u''': (number) <translate>u coordinate</translate> <br/>
'''v''': (number) <translate>v coordinate</translate> <br/>
'''v''': (number) <translate>v coordinate</translate> <br/>
=== Examples ===
=== <translate>Examples</translate> ===
'''Example'''<br/>
'''Example'''<br/>
<source lang="lua">-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100).
<source lang="lua">-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100).

Revision as of 06:28, 24 August 2018

Available since: Gideros 2012.09

Description


Sets a texture coordinate at texture coordinate array. Indices are start from 1. If the texture coordinate array is not large enough, it's expanded automatically.

 Mesh:setTextureCoordinate(i,u,v)

Parameters

i: (number) index
u: (number) u coordinate
v: (number) v coordinate

Examples

Example

-- 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)