Difference between revisions of "Sprite:setEffectConstant"

From GiderosMobile
(Created page with "__NOTOC__ <languages /> '''<translate>Available since</translate>:''' Gideros 2021.1<br/> '''<translate>Class</translate>:''' Sprite<br/> === <tr...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2021.1<br/>
'''<translate>Available since</translate>:''' Gideros 2021.1<br/>
+
'''Class:''' [[Sprite]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate>To change the value of an effect constant from lua</translate>
+
Change the value of an effect constant from lua.
 
<source lang="lua">
 
<source lang="lua">
Sprite:setEffectConstant(effectIndex,uniform name,data type,mult,data)
+
Sprite:setEffectConstant(effectIndex,uniform name,data type,mult,data)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''effectIndex''': (int) The effect index in the effect stack <br/>
+
=== Parameters ===
'''uniform name''': (string) <translate>The uniform name to change</translate> <br/>
+
'''effectIndex''': (int) the effect index in the effect stack<br/>
'''data type''': (int) <translate>The type if data to set (one of the Shader.Cxxx constants)</translate> <br/>
+
'''uniform name''': (string) the uniform name to change<br/>
'''mult''': (number) <translate>number of elements of the given type to set</translate> <br/>
+
'''data type''': (int) the type if data to set (one of the Shader.Cxxx constants)<br/>
'''data''': (varies) <translate>And the actual data to set, either as a table or as multiple arguments</translate> <br/>
+
'''mult''': (number) number of elements of the given type to set<br/>
 +
'''data''': (varies) and the actual data to set, either as a table or as multiple arguments<br/>
  
 
{{Sprite}}
 
{{Sprite}}

Revision as of 19:14, 7 February 2023

Available since: Gideros 2021.1
Class: Sprite

Description

Change the value of an effect constant from lua.

Sprite:setEffectConstant(effectIndex,uniform name,data type,mult,data)

Parameters

effectIndex: (int) the effect index in the effect stack
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