Difference between revisions of "Sprite:setShaderConstant"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2017.4<br/>
 
'''Available since:''' Gideros 2017.4<br/>
 
=== Description ===
 
=== Description ===
To change the value of a uniform from lua
+
<translate>To change the value of a uniform from lua</translate>
 
<source lang="lua">
 
<source lang="lua">
 
  Sprite:setShaderConstant(uniform name,data type,mult,data)
 
  Sprite:setShaderConstant(uniform name,data type,mult,data)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''uniform name''': (string) The uniform name to change <br/>
+
'''uniform name''': (string) <translate>The uniform name to change</translate> <br/>
'''data type''': (int) The type if data to set (one of the Shader.Cxxx constants) <br/>
+
'''data type''': (int) <translate>The type if data to set (one of the Shader.Cxxx constants)</translate> <br/>
'''mult''': (number) number of elements of the given type to set <br/>
+
'''mult''': (number) <translate>number of elements of the given type to set</translate> <br/>
'''data''': (varies) And the actual data to set, either as a table or as multiple arguments <br/>
+
'''data''': (varies) <translate>And the actual data to set, either as a table or as multiple arguments</translate> <br/>

Revision as of 13:34, 23 August 2018

Available since: Gideros 2017.4

Description

To change the value of a uniform from lua

 Sprite:setShaderConstant(uniform name,data type,mult,data)

Parameters

uniform name: (string) The uniform name to change
data type: (int) The type if data to set (one of the Shader.Cxxx constants)
mult: (number) number of elements of the given type to set
data: (varies) And the actual data to set, either as a table or as multiple arguments