(Solved)(Android) How to know when my game gets in background?

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
s0ft
Prole
Posts: 3
Joined: Sun Jan 17, 2016 12:57 pm
Location: Italy

(Solved)(Android) How to know when my game gets in background?

Post by s0ft »

I have a little problem in my game: when the game gets put in background the music keeps playing. I already have a togglePause() function that pauses the game, but I can't find any event or something that tells me when the app is in background even though I've been googling for an hour or so. Does anybody have a solution?
Last edited by s0ft on Thu Feb 04, 2016 3:07 pm, edited 1 time in total.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: (Android) How to know when my game gets in background?

Post by Nixola »

You should use [wiki]love.focus[/wiki] for that. The current version currently has some issues about android and background though, they'll be fixed in 0.10.1.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
s0ft
Prole
Posts: 3
Joined: Sun Jan 17, 2016 12:57 pm
Location: Italy

Re: (Android) How to know when my game gets in background?

Post by s0ft »

Alright! Thanks for the fast response! :)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 5 guests