Difference between revisions of "Mesh:setTextureCoordinate"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2012.09<br/>
+
'''Available since:''' Gideros 2012.09<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Mesh|Mesh]]<br/>
+
'''Class:''' [[Mesh]]<br/>
=== <translate>Description</translate> ===
+
 
<translate><br />
+
=== Description ===
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.
<br /></translate>
+
<syntaxhighlight lang="lua">
<source lang="lua">
+
Mesh:setTextureCoordinate(i,u,v)
Mesh:setTextureCoordinate(i,u,v)
+
</syntaxhighlight>
</source>
+
 
=== <translate>Parameters</translate> ===
+
Indices start from 1. If the texture coordinate array is not large enough, it is automatically expanded.
'''i''': (number) <translate>index</translate> <br/>
+
 
'''u''': (number) <translate>u coordinate</translate> <br/>
+
=== Parameters ===
'''v''': (number) <translate>v coordinate</translate> <br/>
+
'''i''': (number) index<br/>
=== <translate>Examples</translate> ===
+
'''u''': (number) u coordinate<br/>
'''Example'''<br/>
+
'''v''': (number) v coordinate<br/>
<source lang="lua">-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100).
+
 
 +
=== Example ===
 +
'''Setting a texture coordinate'''
 +
<syntaxhighlight 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)
 +
</syntaxhighlight>
 +
 
 +
{{Mesh}}

Latest revision as of 14:30, 13 July 2023

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)