Difference between revisions of "Sprite:set"
From GiderosMobile
Line 7: | Line 7: | ||
<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 /></translate> | <br /></translate> |
Revision as of 09:36, 24 August 2018
Available since: Gideros 2011.6
Class: Sprite
Description
Sets 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"
Sprite:set(param,value)
Parameters
param: (string) The name of the parameter
value: (number) The new value of the specified parameter
Examples
Example
-- the following two lines do the same thing
sprite:setX(10)
sprite:set("x", 10)
-- the following two lines do the same thing
sprite:setY(10)
sprite:set("y", 10)
-- the following two lines do the same thing
sprite:setRotation(10)
sprite:set("rotation", 10)
-- the following two lines do the same thing
sprite:setScaleX(0.5)
sprite:set("scaleX", 0.5)
-- the following two lines do the same thing
sprite:setScaleY(0.5)
sprite:set("scaleY", 0.5)
-- the following two lines do the same thing
sprite:setScale(0.5)
sprite:set("scale", 0.5)