I can't take a screenshot

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
brokestorm
Prole
Posts: 2
Joined: Sun Oct 08, 2017 8:34 am

I can't take a screenshot

Post by brokestorm »

Hi, guys

I've been trying to search an answer in the forum for myyy problem, but doesn't matter how I do this, it just doesn't work for me.

in the code, i'm doing this:

Code: Select all

function love.load()
  love.filesystem.setIdentity('HardData');
  -- (...)
end

  -- (...)
  
 function love.keypressed(enter)
   local screenshot = love.graphics.newScreenshot();
   screenshot:encode('png', os.time() .. '.png');
   love.event.quit()
end

  --(...)
  
i'm just following the example shown in the wiki, as you can see, but it doesn''t work anyway.
'HardData' is a directory which I created manually, and it's in the same directory than the main.lua.
Do I need to create a canvas or something like that? I'm just drawing an image and then drawing some circles in it.

hope you guys can guess my problem. thx in advance.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: I can't take a screenshot

Post by zorg »

Hi and welcome to the forums.

You can't save to the directory where main.lua is, your save directory's location is os-dependent, and could be one of these, as the wiki states: love.filesystem.
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.
brokestorm
Prole
Posts: 2
Joined: Sun Oct 08, 2017 8:34 am

Re: I can't take a screenshot

Post by brokestorm »

Hahaha thank you very much! I was going straight to the functions page, so I didn't noticed this.

I really apreciate your help!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest