Page 1 of 1

Having problems with the newScreenshot() feature

Posted: Sun Oct 13, 2019 3:25 pm
by benj7126
Hey...

I seem to be having problems with the love.graphics.newScreenshot()

When i run my program it says:
attempt to call field 'newScreenshot' (a nil value)

The example

Code: Select all

function love.load()
    love.filesystem.setIdentity('screenshot_example');
end
 
function love.keypressed()
    local screenshot = love.graphics.newScreenshot();
    screenshot:encode('png', os.time() .. '.png');
end
Btw.
This is me following the example in the love2d wiki

Plz help :?

Re: Having problems with the newScreenshot() feature

Posted: Sun Oct 13, 2019 9:32 pm
by zorg
Hi and welcome to the forums.

Did you read the glaring red box at the top of the wiki article? :3

> Removed in LÖVE 11.0
> It has been replaced by love.graphics.captureScreenshot.

Re: Having problems with the newScreenshot() feature

Posted: Tue Oct 15, 2019 7:29 pm
by benj7126
Thx

xD