love.graphics.point() and similar after relaunch

A project to port LÖVE to Android handhelds
Locked
Contezero
Prole
Posts: 3
Joined: Sun Nov 30, 2014 1:14 pm

love.graphics.point() and similar after relaunch

Post 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!
User avatar
Reenen
Prole
Posts: 44
Joined: Tue Nov 08, 2011 9:44 am

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

Post 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.
Contezero
Prole
Posts: 3
Joined: Sun Nov 30, 2014 1:14 pm

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

Post 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?
Contezero
Prole
Posts: 3
Joined: Sun Nov 30, 2014 1:14 pm

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

Post 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()
Locked

Who is online

Users browsing this forum: No registered users and 0 guests