Difference between revisions of "GTween:swapValues"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2010-2011<br/> '''Class:''' GTween<br/> === Description === Swaps the init and end values for the tween, effectively reversing it...") |
|||
| Line 9: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | This should generally only be called before the tween starts playing. This will force the tween to init if it hasn't already done so, which may result in an | + | This should generally only be called before the tween starts playing. This will force the tween to init if it hasn't already done so, which may result in an "init" call. |
| − | It will also force a render (so the target immediately jumps to the new values) which will result in the | + | It will also force a render (so the target immediately jumps to the new values) which will result in the "change" callback being called. |
You can also use the special "swapValues" property on the props parameter of the GTween constructor to call '':swapValues()'' after the values are set. | You can also use the special "swapValues" property on the props parameter of the GTween constructor to call '':swapValues()'' after the values are set. | ||
Latest revision as of 07:29, 8 December 2025
Available since: Gideros 2010-2011
Class: GTween
Description
Swaps the init and end values for the tween, effectively reversing it.
GTween:swapValues()
This should generally only be called before the tween starts playing. This will force the tween to init if it hasn't already done so, which may result in an "init" call.
It will also force a render (so the target immediately jumps to the new values) which will result in the "change" callback being called.
You can also use the special "swapValues" property on the props parameter of the GTween constructor to call :swapValues() after the values are set.
Example
Tween the target from 100,100 to its current position
GTween.new(ball, 2, { x=100, y=100 }, { swapValues=true } )
- GTween
- GTween.new
- GTween.nextTween
- GTween.stopAll
- GTween:deleteValue
- GTween:getDelay
- GTween:getInitValue
- GTween:getPosition
- GTween:getValue
- GTween:getValues
- GTween:init2
- GTween:isPaused
- GTween:resetValues
- GTween:setDelay
- GTween:setPaused
- GTween:setPosition
- GTween:setValue
- GTween:setValues
- GTween:swapValues
- GTween:toBeginning
- GTween:toEnd