Created
August 15, 2012 18:00
-
-
Save anonymous/3361983 to your computer and use it in GitHub Desktop.
performWithDelay and Closures
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 rect = display.newRect( 0, 0, 100, 100 ) | |
local function timerListener( object ) | |
return function() | |
print( "Rect x,y = ", object.x, object.y ) | |
end | |
end | |
timer.performWithDelay( 1000, timerListener( rect ) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment