encode doesn't create file on android

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
ceana
Prole
Posts: 9
Joined: Fri Aug 11, 2017 5:08 pm
Location: A place where English is taught

encode doesn't create file on android

Post 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?
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Re: encode doesn't create file on android

Post 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.
ceana
Prole
Posts: 9
Joined: Fri Aug 11, 2017 5:08 pm
Location: A place where English is taught

Re: encode doesn't create file on android

Post 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.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 73 guests