Forked from evandro-costa/InfiniteTransitionLoop.lua
Last active
August 29, 2015 14:16
-
-
Save DoubleSlashDesign2/b587ca479595c14418f7 to your computer and use it in GitHub Desktop.
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment