Difference between revisions of "Sprite:get"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 +
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
Line 6: Line 7:
 
<br />
 
<br />
 
<ul><br />
 
<ul><br />
<li>[[Special:MyLanguage/"x"|"x"]]</li><br />
+
<li>`"x"`</li><br />
<li>[[Special:MyLanguage/"y"|"y"]]</li><br />
+
<li>`"y"`</li><br />
<li>[[Special:MyLanguage/"z"|"z"]]</li><br />
+
<li>`"z"`</li><br />
<li>[[Special:MyLanguage/"rotation"|"rotation"]]</li><br />
+
<li>`"rotation"`</li><br />
<li>[[Special:MyLanguage/"rotationX"|"rotationX"]]</li><br />
+
<li>`"rotationX"`</li><br />
<li>[[Special:MyLanguage/"rotationY"|"rotationY"]]</li><br />
+
<li>`"rotationY"`</li><br />
<li>[[Special:MyLanguage/"scaleX"|"scaleX"]]</li><br />
+
<li>`"scaleX"`</li><br />
<li>[[Special:MyLanguage/"scaleY"|"scaleY"]]</li><br />
+
<li>`"scaleY"`</li><br />
<li>[[Special:MyLanguage/"scaleZ"|"scaleZ"]]</li><br />
+
<li>`"scaleZ"`</li><br />
<li>[[Special:MyLanguage/"alpha"|"alpha"]]</li><br />
+
<li>`"alpha"`</li><br />
<li>[[Special:MyLanguage/"redMultiplier"|"redMultiplier"]]</li><br />
+
<li>`"redMultiplier"`</li><br />
<li>[[Special:MyLanguage/"greenMultiplier"|"greenMultiplier"]]</li><br />
+
<li>`"greenMultiplier"`</li><br />
<li>[[Special:MyLanguage/"blueMultiplier"|"blueMultiplier"]]</li><br />
+
<li>`"blueMultiplier"`</li><br />
<li>[[Special:MyLanguage/"alphaMultiplier"|"alphaMultiplier"]]</li><br />
+
<li>`"alphaMultiplier"`</li><br />
<li>[[Special:MyLanguage/"anchorX"|"anchorX"]]</li><br />
+
<li>`"anchorX"`</li><br />
<li>[[Special:MyLanguage/"anchorY"|"anchorY"]]</li><br />
+
<li>`"anchorY"`</li><br />
<li>[[Special:MyLanguage/"anchorZ"|"anchorZ"]]</li><br />
+
<li>`"anchorZ"`</li><br />
 
</ul><br />
 
</ul><br />
 
<br /></translate>
 
<br /></translate>

Revision as of 09:28, 24 August 2018

Available since: Gideros 2011.6
Class: Sprite

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;)