Page 1 of 1

Delaying a function

Posted: Sun Apr 09, 2017 11:14 am
by Lezalith
Hey everyone, I hope you're having a lovely morning/afternoon/evening.

I have two screens. teaching_done_morning and teaching_done_afternoon. While transitioning between those two, stuff changes too quickly. You can actually see the changes take place before the transition between the two screens is finished.

I thought I could delay part of the function that calls the second screen.

Code: Select all

    def delayedStuff():
        renpy.transition(fade)
        renpy.show_screen("teaching_done_afternoon")
        # Delay needed here, so ^ this can finish transitioning, and after the transition is done, those other two screen bellow show. #
        if InTeachingMorning == "Jack" or InTeachingMorning == "Suzy" or InTeachingMorning == "Daniel" or InTeachingMorning == "Lily" or InTeachingMorning == "Erik":
            renpy.show_screen("afternoonBarCompanion")
            renpy.show_screen("teachingSketchesAfternoon")
        else:
            renpy.show_screen("afternoonBarNormal")
            renpy.show_screen("teachingSketchesAfternoon")
However, I have no idea how I'd do that. I tried renpy.pause and time.sleep, neither worked though.
renpy.pause doesn't see to have effect at all, time.sleep pauses the whole program instead of just the function.

I know delaying stuff is complicated.
Is there a Renpy function that could check if the transition has finished, and then I could call the rest of the stuff?