Page 1 of 1

love.graphics.point() and similar after relaunch

Posted: Sun Nov 30, 2014 3:48 pm
by Contezero
Hi there! i'm experimenting a bit with love-android (i just get the source a week ago, so i think it's the latest version). When i launch my apk with my own game.love everything goes fine, then when exiting (with the usual love.event.quit() ) and re-launching the apk, it won't draw lines, poligons and points. Everything else seems ok.
Am i doing anything wrong? here's the stripped off main.lua code:

Code: Select all

function love.load()
  text = "test"
end

function love.draw()
  love.graphics.print(text,20,20)
  love.graphics.setPointSize(40,40)
  love.graphics.point(60,60)
end

function love.keypressed(key)
  if key == "escape" then
    love.event.quit()
  end
end
text printing is ok (as drawing image, playing sounds and so on) but not that love.graphics.point(60,60)
Thank you in advance!

Re: love.graphics.point() and similar after relaunch

Posted: Tue Dec 02, 2014 11:59 am
by Reenen
I don't know if this is related, but android apps doesn't close like it does on windows. It just sleeps. So unless you are *killing* the app the app doesn't reload. (load code isn't run again). So in my App I changed the load code to focus code.

Re: love.graphics.point() and similar after relaunch

Posted: Tue Dec 02, 2014 12:55 pm
by Contezero
Reenen wrote:I don't know if this is related, but android apps doesn't close like it does on windows. It just sleeps. So unless you are *killing* the app the app doesn't reload. (load code isn't run again). So in my App I changed the load code to focus code.
Sure, saw that, but seems that love.event.quit() prevents from returning in a state where love.graphics.point() (among other similar functions) actually draws something (having text = "test" in load() as in my little sample isn't an issue).

Doesn't happen if pausing with the power button or the other physical button i have on my old phone, i.e. points and polygons got drawn without problems on returning.
Is there a way to pause the app by calling any function in love.keypressed(key) with key == "escape", therefore letting it return in a correct state?

Re: love.graphics.point() and similar after relaunch

Posted: Wed Dec 03, 2014 7:51 pm
by Contezero
Contezero wrote: Is there a way to pause the app by calling any function in love.keypressed(key) with key == "escape", therefore letting it return in a correct state?
Well, after some little experimenting, found out that the shortest way to fix that behaviour is putting a os.exit() instead of a love.event.quit()