Difference between revisions of "Sprite:get"
From GiderosMobile
Line 2: | Line 2: | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
=== Description === | === Description === | ||
− | <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 /> | ||
<br /> | <br /> | ||
<ul><br /> | <ul><br /> | ||
− | <li> | + | <li>[[["x"]]]</li><br /> |
− | <li> | + | <li>[[["y"]]]</li><br /> |
− | <li> | + | <li>[[["z"]]]</li><br /> |
− | <li> | + | <li>[[["rotation"]]]</li><br /> |
− | <li> | + | <li>[[["rotationX"]]]</li><br /> |
− | <li> | + | <li>[[["rotationY"]]]</li><br /> |
− | <li> | + | <li>[[["scaleX"]]]</li><br /> |
− | <li> | + | <li>[[["scaleY"]]]</li><br /> |
− | <li> | + | <li>[[["scaleZ"]]]</li><br /> |
− | <li> | + | <li>[[["alpha"]]]</li><br /> |
− | <li> | + | <li>[[["redMultiplier"]]]</li><br /> |
− | <li> | + | <li>[[["greenMultiplier"]]]</li><br /> |
− | <li> | + | <li>[[["blueMultiplier"]]]</li><br /> |
− | <li> | + | <li>[[["alphaMultiplier"]]]</li><br /> |
− | <li> | + | <li>[[["anchorX"]]]</li><br /> |
− | <li> | + | <li>[[["anchorY"]]]</li><br /> |
− | <li> | + | <li>[[["anchorZ"]]]</li><br /> |
</ul><br /> | </ul><br /> | ||
− | <br /> | + | <br /></translate> |
<source lang="lua"> | <source lang="lua"> | ||
(number) = Sprite:get(param) | (number) = Sprite:get(param) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
− | '''param''': (string) The name of the parameter <br/> | + | '''param''': (string) <translate>The name of the parameter</translate> <br/> |
=== Return values === | === Return values === | ||
− | '''Returns''' (number) The value of the parameter<br/> | + | '''Returns''' (number) <translate>The value of the parameter</translate><br/> |
=== Examples === | === Examples === | ||
'''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 |
− | x = sprite:getX() | + | x = sprite:getX() |
− | x = sprite:get("x") | + | x = sprite:get("x") |
− | + | ||
− | -- the following two lines do the same thing | + | -- the following two lines do the same thing |
− | y = sprite:getY() | + | y = sprite:getY() |
− | y = sprite:get("y") | + | y = sprite:get("y") |
− | + | ||
− | -- the following two lines do the same thing | + | -- the following two lines do the same thing |
− | rotation = sprite:getRotation() | + | rotation = sprite:getRotation() |
− | rotation = sprite:get("rotation") | + | rotation = sprite:get("rotation") |
− | + | ||
− | -- the following two lines do the same thing | + | -- the following two lines do the same thing |
− | scaleX = sprite:getScaleX() | + | scaleX = sprite:getScaleX() |
− | scaleX = sprite:get("scaleX") | + | scaleX = sprite:get("scaleX") |
− | + | ||
− | -- the following two lines do the same thing | + | -- the following two lines do the same thing |
− | scaleY = sprite:getScaleY() | + | scaleY = sprite:getScaleY() |
− | scaleY = sprite:get("scaleY") | + | scaleY = sprite:get("scaleY")</source> |
Revision as of 13:33, 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
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")