Problem writing a screenshot.
Posted: Sat May 26, 2012 1:03 pm
Hi, I'm having trouble writing with the newScreenshot() function.
Why does imageData = screenshot:encode( "png" ) return nil? What am I doing wrong here?
Thanks.
Code: Select all
function love.load()
love.filesystem.setIdentity("screenshot")
end
function love.draw()
took = true
screenshot = love.graphics.newScreenshot()
if took then
took = false
imageData = screenshot:encode( "png" )
love.filesystem.write( "ss.png", imageData, 500 )
end
end
Thanks.