mirror of
https://github.com/love2d/love.git
synced 2026-08-12 00:20:52 +02:00
add callback variant for love.graphics.captureScreenshot
This commit is contained in:
@@ -1550,6 +1550,11 @@ love.test.graphics.captureScreenshot = function(test)
|
||||
-- need to wait until end of the frame for the screenshot
|
||||
test:assertNotNil(love.filesystem.openFile('example-screenshot.png', 'r'))
|
||||
love.filesystem.remove('example-screenshot.png')
|
||||
-- test callback version
|
||||
love.graphics.captureScreenshot(function (idata)
|
||||
test:assertNotEquals(nil, idata, 'check we have image data')
|
||||
end)
|
||||
test:waitFrames(10)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user