Skip to content

Instantly share code, notes, and snippets.

@vib3oh
Created November 15, 2012 17:20
Show Gist options
  • Save vib3oh/4079892 to your computer and use it in GitHub Desktop.
Save vib3oh/4079892 to your computer and use it in GitHub Desktop.
Apply an existing "AKtween" to an object
--Create a new AKtween
local tween = AKtween:newTween({time=5000, y=-600, ease='outQuad',
onComplete={time=5000, y=600, ease='inQuad'}
})
--Create a display object/ image/ sprite
local obj = display.newCircle(0,0,20)
--Apply tween to the object, with a tween name
tween:apply(obj, 'moveY')
--Play tween
obj:playTween('moveY')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment