Sprite:get

From GiderosMobile
Revision as of 11:44, 23 August 2018 by Hgy29 (talk | contribs)

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<br />
x = sprite:getX()<br />
x = sprite:get(&quot;x&quot;)<br />
	<br />
-- the following two lines do the same thing<br />
y = sprite:getY()<br />
y = sprite:get(&quot;y&quot;)<br />
<br />
-- the following two lines do the same thing<br />
rotation = sprite:getRotation()<br />
rotation = sprite:get(&quot;rotation&quot;)<br />
<br />
-- the following two lines do the same thing<br />
scaleX = sprite:getScaleX()<br />
scaleX = sprite:get(&quot;scaleX&quot;)<br />
<br />
-- the following two lines do the same thing<br />
scaleY = sprite:getScaleY()<br />
scaleY = sprite:get(&quot;scaleY&quot;)<br />