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.


    Pausing inside classes with "Scene" object

    Pythonista
    game pause
    2
    3
    2907
    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.
    • happy_variable
      happy_variable last edited by

      How do you pause the class with object "Scene" or "SpriteNode" for a certain amount of time, while leaving other classes to work?

      I am not sure that time.sleep() does the job.

      Thanks for your answers, programmers!

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

        Hi @happy_variable

        What exactly do you want to achieve. There are several methods that might help.

        If it is primarily animations etc, then SpriteNode.run_action() will allow you to apply actions to nodes. There is an Action.wait() method which might be what you are looking for. Action.sequence() and Action.group allow you to run multiple actions sequentially or together.

        Action.call() can call any function as part of an animation. It can thus be set up to function like a timer or delay.

        Another option would be ui.delay() which calls a function after a particular delay.

        time.sleep() functions might need to be decorated with @ui.in_background to work as expected. This can sometimes cause problems if several processes are running in the background as well.

        I hope this helps a little. Let me know exactly what you need to do and I could make specific suggestions.

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

          Thanks, @chriswilson!

          I have noticed about the Action.wait() method before you answered (but later than posting this question), but still thanks for your support. I already got all the information I wanted and expected, so I don't need concrete suggestions on concrete topics.

          I'm going to post a new question soon, and I'll be happy to get supported by you on it, again Thanks!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors