Difference between revisions of "Sprite:get"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<languages />
 
'''<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>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>

Revision as of 10:58, 3 September 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;)