Page 1 of 1
encode doesn't create file on android
Posted: Mon Aug 28, 2017 1:02 pm
by ceana
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
I run this example but can't see the .png file on save directory on android, and there is an empty screenshot_excample. is something wrong?
Re: encode doesn't create file on android
Posted: Mon Aug 28, 2017 4:24 pm
by Tjakka5
Its possible that you can't fire the keypressed command on your device, since... well, you don't have a keyboard?
Try moving the code into love.load and see if it works then.
Re: encode doesn't create file on android
Posted: Tue Aug 29, 2017 2:55 am
by ceana
Tjakka5 wrote: ↑Mon Aug 28, 2017 4:24 pm
Its possible that you can't fire the keypressed command on your device, since... well, you don't have a keyboard?
Try moving the code into love.load and see if it works then.
oh sorry, I forgot this, before I post here I had rewritten it on love.load and love.touch, and I got the same result.