Last active
March 22, 2020 02:00
-
-
Save evandro-costa/db6f19fb6e1a5146d79b to your computer and use it in GitHub Desktop.
Corona SDK - Infinite Transition Loop sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local animate = function(obj, ref) | |
if ref then | |
obj.transitionLoop = ref | |
end | |
-- Optional resets: | |
obj.x = 0 | |
transition.to(obj, { | |
x = 10, | |
-- Do not remove: | |
onComplete = obj.transitionLoop | |
}) | |
end | |
-- Start infinite loop: | |
animate(Target, animate) | |
-- To stop infinite loop: | |
-- Target.transitionLoop = nil |
Hi, any idea what to do if I want to link multiple transitions together and still loop them?!
You need to edit the animate
function and add your customs transitions :)
thank you very much evandro-costa, really appreciated the example!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, any idea what to do if I want to link multiple transitions together and still loop them?!