Im trying to make an app that takes thousands of screenshots and combines them into one video file. I havent got around to the combining them into movie bit yet, because im stuck on how to constantly take screenshots until the button is clicked to stop it.
This is what I have so far:
local background = display.newImage('background.png') local captureButton = display.newImage('captureBtn.png') captureButton:setReferencePoint(display.CenterReferencePoint) captureButton.x = display.contentWidth \* 0.5 captureButton.y = display.contentHeight \* 0.5 local screenshot = display.captureScreen(true) function captureButton:tap(e) local repeattask = timers.Repeat(function() timer.performWithDelay(2, screemshot, 10) end, 150) end media.show(media.PhotoLibrary)