Skip to content

Instantly share code, notes, and snippets.

Created August 15, 2012 18:00
Show Gist options
  • Save anonymous/3361983 to your computer and use it in GitHub Desktop.
Save anonymous/3361983 to your computer and use it in GitHub Desktop.
performWithDelay and Closures
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