Difference between revisions of "Mesh:setTextureCoordinate"

From GiderosMobile
(removed language stuff)
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Sets a texture coordinate at texture coordinate array.
 
Sets a texture coordinate at texture coordinate array.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
Mesh:setTextureCoordinate(i,u,v)
 
Mesh:setTextureCoordinate(i,u,v)
</source>
+
</syntaxhighlight>
  
 
Indices start from 1. If the texture coordinate array is not large enough, it is automatically expanded.
 
Indices start from 1. If the texture coordinate array is not large enough, it is automatically expanded.
Line 18: Line 18:
 
=== Example ===
 
=== Example ===
 
'''Setting a texture coordinate'''
 
'''Setting a texture coordinate'''
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
-- set the first 3 texture coordinates as (0, 0), (100, 0) and (0, 100)
 
-- 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)
 
mesh:setTextureCoordinate(3, 0, 100)
</source>
+
</syntaxhighlight>
  
 
{{Mesh}}
 
{{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)