Creates a screenshot and returns the image data.
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!
screenshot = love.graphics.newScreenshot( )
None.
ImageData screenshot Available since LÖVE 0.9.0
This variant is not supported in earlier versions.
screenshot = love.graphics.newScreenshot( copyAlpha )
boolean copyAlpha (false)ImageData screenshotCreate a new screenshot and write it to the save directory.
function love.load()
love.filesystem.setIdentity('screenshot_example');
end
function love.keypressed()
local screenshot = love.graphics.newScreenshot();
screenshot:encode('png', os.time() .. '.png');
end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.graphics.newScreenshot