Having problems with the newScreenshot() feature

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
benj7126
Prole
Posts: 2
Joined: Sun Oct 13, 2019 3:16 pm

Having problems with the newScreenshot() feature

Post by benj7126 » Sun Oct 13, 2019 3:25 pm

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 :?
Attachments
game.love
My game
(1.55 KiB) Downloaded 8 times
Thingy.love
Just the example
(261 Bytes) Downloaded 9 times

User avatar
zorg
Party member
Posts: 2720
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Having problems with the newScreenshot() feature

Post by zorg » Sun Oct 13, 2019 9:32 pm

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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

benj7126
Prole
Posts: 2
Joined: Sun Oct 13, 2019 3:16 pm

Re: Having problems with the newScreenshot() feature

Post by benj7126 » Tue Oct 15, 2019 7:29 pm

Thx

xD

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests