omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Screen auto-lock

    Pythonista
    2
    2
    1677
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • krizex
      krizex last edited by

      I have a game in which everything is controlled by gravity(). So after a while the device decides that nothing happens and the screen goes blank. Is there a way to avoid this? (without changing device auto-locking time settings)

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by omz

        Yes, you can add console.set_idle_timer_disabled(True) to your setup method to turn off auto-locking when your game starts.

        You should also add a stop method to your scene (if you haven't already), and go back to the normal behavior there:

        class MyScene (Scene):
            # ...
            def stop(self):
                # Note: This will be called automatically when the scene is closed.
                console.set_idle_timer_disabled(False)
        
        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        Powered by NodeBB Forums | Contributors