Difference between revisions of "Sprite:get"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
<br />
+
<translate><br />
 
Returns the specified property of this sprite instance by its name. These names are supported:<br />
 
Returns the specified property of this sprite instance by its name. These names are supported:<br />
 
<br />
 
<br />
 
<ul><br />
 
<ul><br />
<li>`"x"`</li><br />
+
<li>[[["x"]]]</li><br />
<li>`"y"`</li><br />
+
<li>[[["y"]]]</li><br />
<li>`"z"`</li><br />
+
<li>[[["z"]]]</li><br />
<li>`"rotation"`</li><br />
+
<li>[[["rotation"]]]</li><br />
<li>`"rotationX"`</li><br />
+
<li>[[["rotationX"]]]</li><br />
<li>`"rotationY"`</li><br />
+
<li>[[["rotationY"]]]</li><br />
<li>`"scaleX"`</li><br />
+
<li>[[["scaleX"]]]</li><br />
<li>`"scaleY"`</li><br />
+
<li>[[["scaleY"]]]</li><br />
<li>`"scaleZ"`</li><br />
+
<li>[[["scaleZ"]]]</li><br />
<li>`"alpha"`</li><br />
+
<li>[[["alpha"]]]</li><br />
<li>`"redMultiplier"`</li><br />
+
<li>[[["redMultiplier"]]]</li><br />
<li>`"greenMultiplier"`</li><br />
+
<li>[[["greenMultiplier"]]]</li><br />
<li>`"blueMultiplier"`</li><br />
+
<li>[[["blueMultiplier"]]]</li><br />
<li>`"alphaMultiplier"`</li><br />
+
<li>[[["alphaMultiplier"]]]</li><br />
<li>`"anchorX"`</li><br />
+
<li>[[["anchorX"]]]</li><br />
<li>`"anchorY"`</li><br />
+
<li>[[["anchorY"]]]</li><br />
<li>`"anchorZ"`</li><br />
+
<li>[[["anchorZ"]]]</li><br />
 
</ul><br />
 
</ul><br />
<br />
+
<br /></translate>
 
<source lang="lua">
 
<source lang="lua">
 
(number) = Sprite:get(param)
 
(number) = Sprite:get(param)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''param''': (string) The name of the parameter <br/>
+
'''param''': (string) <translate>The name of the parameter</translate> <br/>
 
=== Return values ===
 
=== Return values ===
'''Returns''' (number) The value of the parameter<br/>
+
'''Returns''' (number) <translate>The value of the parameter</translate><br/>
 
=== Examples ===
 
=== Examples ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">-- the following two lines do the same thing<br />
+
<source lang="lua">-- the following two lines do the same thing
x = sprite:getX()<br />
+
x = sprite:getX()
x = sprite:get(&quot;x&quot;)<br />
+
x = sprite:get(&quot;x&quot;)
<br />
+
-- the following two lines do the same thing<br />
+
-- the following two lines do the same thing
y = sprite:getY()<br />
+
y = sprite:getY()
y = sprite:get(&quot;y&quot;)<br />
+
y = sprite:get(&quot;y&quot;)
<br />
+
 
-- the following two lines do the same thing<br />
+
-- the following two lines do the same thing
rotation = sprite:getRotation()<br />
+
rotation = sprite:getRotation()
rotation = sprite:get(&quot;rotation&quot;)<br />
+
rotation = sprite:get(&quot;rotation&quot;)
<br />
+
 
-- the following two lines do the same thing<br />
+
-- the following two lines do the same thing
scaleX = sprite:getScaleX()<br />
+
scaleX = sprite:getScaleX()
scaleX = sprite:get(&quot;scaleX&quot;)<br />
+
scaleX = sprite:get(&quot;scaleX&quot;)
<br />
+
 
-- the following two lines do the same thing<br />
+
-- the following two lines do the same thing
scaleY = sprite:getScaleY()<br />
+
scaleY = sprite:getScaleY()
scaleY = sprite:get(&quot;scaleY&quot;)<br /></source>
+
scaleY = sprite:get(&quot;scaleY&quot;)</source>

Revision as of 14:33, 23 August 2018

Available since: Gideros 2011.6

Description


Returns 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"]]]



(number) = Sprite:get(param)

Parameters

param: (string) The name of the parameter

Return values

Returns (number) The value of the parameter

Examples

Example

-- the following two lines do the same thing
x = sprite:getX()
x = sprite:get(&quot;x&quot;)
	
-- the following two lines do the same thing
y = sprite:getY()
y = sprite:get(&quot;y&quot;)

-- the following two lines do the same thing
rotation = sprite:getRotation()
rotation = sprite:get(&quot;rotation&quot;)

-- the following two lines do the same thing
scaleX = sprite:getScaleX()
scaleX = sprite:get(&quot;scaleX&quot;)

-- the following two lines do the same thing
scaleY = sprite:getScaleY()
scaleY = sprite:get(&quot;scaleY&quot;)