Difference between revisions of "Sprite:get"
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 /> | ||
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 /> | ||
Line 28: | Line 28: | ||
(number) = Sprite:get(param) | (number) = Sprite:get(param) | ||
</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/> | ||
− | === Return values === | + | === <translate>Return values</translate> === |
− | '''Returns''' (number) <translate>The value of the parameter</translate><br/> | + | '''<translate>Returns</translate>''' (number) <translate>The value of the 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 07:27, 24 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("x")
-- the following two lines do the same thing
y = sprite:getY()
y = sprite:get("y")
-- the following two lines do the same thing
rotation = sprite:getRotation()
rotation = sprite:get("rotation")
-- the following two lines do the same thing
scaleX = sprite:getScaleX()
scaleX = sprite:get("scaleX")
-- the following two lines do the same thing
scaleY = sprite:getScaleY()
scaleY = sprite:get("scaleY")