Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Application Entering Background and Entering Foreground

edited December 2015 in Suggestions Posts: 10

Hi,

I've searched the forum and found some topics that discussed the potential for detecting when an application enters and exits background/foreground...

function appEnteredBackground()
end

function appEnteredForeground()
end

This would be very useful for applications involving the physics engine, since it uses a calculation stepper, which essentially simulates it running in the background when your application resumes foreground execution.

Simply being able to put physics pause and resume in these example functions would be incredibly helpful.

Any thoughts or workarounds?

Thanks,
John

Comments

  • dave1707dave1707 Mod
    Posts: 6,963

    I'm not sure anything has been added to detect background/foreground usage and I'm not sure if anyone ever found a way to do it reliably either.

  • SimeonSimeon Admin Mod
    Posts: 4,545

    @johnpoore physics should be pausing and resuming on those events automatically. If not then that's a bug in Codea. (Though I'm open to the idea of making those events available in the Codea API too.)

  • dave1707dave1707 Mod
    edited December 2015 Posts: 6,963

    @Simeon Physics calculations/objects don't pause when moved to the background. At least not in the example I tried.

  • IgnatzIgnatz Mod
    Posts: 5,396

    I think it's a good idea to expose these events, especially as iPads now support dual windows and multi tasking.

  • I agree with everyone on this thread. It's definitely not pausing, so if it should be, it's a bug. I also agree that exposing these events would be helpful. Probably not a big deal in the Codea App but as people use Codea as a serious development platform, having access to these types of events would be very useful. Hopefully the bug is an easy fix!

  • Another observation on this topic... Physics also does not pause when you pause Codea in the Codea development environment. @Simeon, do you think any/some of this will make it into the next update? Or it too complicated a change?

Sign In or Register to comment.