Page 1 of 1

I can't take a screenshot

Posted: Sun Oct 08, 2017 8:46 am
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.

Re: I can't take a screenshot

Posted: Sun Oct 08, 2017 10:30 am
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.

Re: I can't take a screenshot

Posted: Mon Oct 09, 2017 1:19 am
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!