Difference between revisions of "Sprite:set"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
=== Description ===
+
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
 
Sets the specified property of this sprite instance by its name. These names are supported:<br />
 
Sets the specified property of this sprite instance by its name. These names are supported:<br />
Line 28: Line 28:
 
  Sprite:set(param,value)
 
  Sprite:set(param,value)
 
</source>
 
</source>
=== Parameters ===
+
=== <translate>Parameters</translate> ===
 
'''param''': (string) <translate>The name of the parameter</translate> <br/>
 
'''param''': (string) <translate>The name of the parameter</translate> <br/>
 
'''value''': (number) <translate>The new value of the specified parameter</translate> <br/>
 
'''value''': (number) <translate>The new value of the specified parameter</translate> <br/>
=== Examples ===
+
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
 
<source lang="lua">-- the following two lines do the same thing
 
<source lang="lua">-- the following two lines do the same thing

Revision as of 08:28, 24 August 2018

Available since: Gideros 2011.6

Description


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



 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)