Difference between revisions of "Sprite:set"

From GiderosMobile
Line 8: Line 8:
 
<br />
 
<br />
 
<ul><br />
 
<ul><br />
<li>''"x"''</li><br />
+
<li>''"x"''</li>
<li>''"y"''</li><br />
+
<li>''"y"''</li>
<li>''"z"''</li><br />
+
<li>''"z"''</li>
<li>''"rotation"''</li><br />
+
<li>''"rotation"''</li>
<li>''"rotationX"''</li><br />
+
<li>''"rotationX"''</li>
<li>''"rotationY"''</li><br />
+
<li>''"rotationY"''</li>
<li>''"scaleX"''</li><br />
+
<li>''"scaleX"''</li>
<li>''"scaleY"''</li><br />
+
<li>''"scaleY"''</li>
<li>''"scaleZ"''</li><br />
+
<li>''"scaleZ"''</li>
<li>''"alpha"''</li><br />
+
<li>''"alpha"''</li>
<li>''"redMultiplier"''</li><br />
+
<li>''"redMultiplier"''</li>
<li>''"greenMultiplier"''</li><br />
+
<li>''"greenMultiplier"''</li>
<li>''"blueMultiplier"''</li><br />
+
<li>''"blueMultiplier"''</li>
<li>''"alphaMultiplier"''</li><br />
+
<li>''"alphaMultiplier"''</li>
<li>''"anchorX"''</li><br />
+
<li>''"anchorX"''</li>
<li>''"anchorY"''</li><br />
+
<li>''"anchorY"''</li>
<li>''"anchorZ"''</li><br />
+
<li>''"anchorZ"''</li>
 
</ul><br />
 
</ul><br />
 
<br /></translate>
 
<br /></translate>
Line 30: Line 30:
 
  Sprite:set(param,value)
 
  Sprite:set(param,value)
 
</source>
 
</source>
 +
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
 
'''param''': (string) <translate>The name of the parameter</translate> <br/>
 
'''param''': (string) <translate>The name of the parameter</translate> <br/>

Revision as of 10:59, 28 February 2020


Available since: Gideros 2011.6
Class: Sprite

Description


Sets the specified property of this sprite instance by its name. These names are supported:


  • "x"
  • "y"
  • "z"
  • "rotation"
  • "rotationX"
  • "rotationY"
  • "scaleX"
  • "scaleY"
  • "scaleZ"
  • "alpha"
  • "redMultiplier"
  • "greenMultiplier"
  • "blueMultiplier"
  • "alphaMultiplier"
  • "anchorX"
  • "anchorY"
  • "anchorZ"



 Sprite:set(param,value)

Parameters

param: (string) The name of the parameter
value: (number) The new value of the specified parameter

Examples

Example

-- the following two lines do the same thing
sprite:setX(10)
sprite:set(&quot;x&quot;, 10)
		
-- the following two lines do the same thing
sprite:setY(10)
sprite:set(&quot;y&quot;, 10)

-- the following two lines do the same thing
sprite:setRotation(10)
sprite:set(&quot;rotation&quot;, 10)

-- the following two lines do the same thing
sprite:setScaleX(0.5)
sprite:set(&quot;scaleX&quot;, 0.5)

-- the following two lines do the same thing
sprite:setScaleY(0.5)
sprite:set(&quot;scaleY&quot;, 0.5)

-- the following two lines do the same thing
sprite:setScale(0.5)
sprite:set(&quot;scale&quot;, 0.5)