Difference between revisions of "Sprite:get"
From GiderosMobile
Line 28: | Line 28: | ||
(number) = Sprite:get(param) | (number) = Sprite:get(param) | ||
</source> | </source> | ||
− | '''param''': (string) The name of the parameter | + | === Parameters === |
+ | '''param''': (string) The name of the parameter <br/> | ||
+ | === Return values === | ||
'''Returns''' (number) The value of the parameter<br/> | '''Returns''' (number) The value of the parameter<br/> | ||
+ | === Examples === | ||
+ | '''Example'''<br/> | ||
+ | <source lang="lua">-- the following two lines do the same thing<br /> | ||
+ | x = sprite:getX()<br /> | ||
+ | x = sprite:get("x")<br /> | ||
+ | <br /> | ||
+ | -- the following two lines do the same thing<br /> | ||
+ | y = sprite:getY()<br /> | ||
+ | y = sprite:get("y")<br /> | ||
+ | <br /> | ||
+ | -- the following two lines do the same thing<br /> | ||
+ | rotation = sprite:getRotation()<br /> | ||
+ | rotation = sprite:get("rotation")<br /> | ||
+ | <br /> | ||
+ | -- the following two lines do the same thing<br /> | ||
+ | scaleX = sprite:getScaleX()<br /> | ||
+ | scaleX = sprite:get("scaleX")<br /> | ||
+ | <br /> | ||
+ | -- the following two lines do the same thing<br /> | ||
+ | scaleY = sprite:getScaleY()<br /> | ||
+ | scaleY = sprite:get("scaleY")<br /></source> |
Revision as of 10:44, 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<br />
x = sprite:getX()<br />
x = sprite:get("x")<br />
<br />
-- the following two lines do the same thing<br />
y = sprite:getY()<br />
y = sprite:get("y")<br />
<br />
-- the following two lines do the same thing<br />
rotation = sprite:getRotation()<br />
rotation = sprite:get("rotation")<br />
<br />
-- the following two lines do the same thing<br />
scaleX = sprite:getScaleX()<br />
scaleX = sprite:get("scaleX")<br />
<br />
-- the following two lines do the same thing<br />
scaleY = sprite:getScaleY()<br />
scaleY = sprite:get("scaleY")<br />