GTween:swapValues

From GiderosMobile
Revision as of 07:29, 8 December 2025 by MoKaLux (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 } )