Adding pause between 'add images' in screen [solved]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Adding pause between 'add images' in screen [solved]

#1 Post by AsHLeX »

Hello! Thanks for your help in advance. I just had somewhat of a silly question, how do I add a timed pause between adding images in a screen:

Code: Select all

screen memoria(horizontal, vertical, rounds):
    # minigame logos
    if game.turn == 0:
        add "minigame/GUI/game_start.png" pos (806,349) #anchor (.5,.5) # pos (1150,180) anchor (.5,.5) zoom .5
    else:
        add "minigame/rounds/rounds left {:02d}.png".format(game.rounds - game.turn + 1) pos (879,15) #anchor (.5,.5) # pos (1150,180) anchor (.5,.5) zoom .5

    # display the cards
    for c in game.cards:
        imagebutton:
            if c.is_face_up:
                idle im.Scale(c.card_img, game.card_width_pixel, game.card_height_pixel)
            else:
                idle im.Scale(game.assets_card_back, game.card_width_pixel, game.card_height_pixel)
How do I add a pause between 'minigame loops' and 'display the cards'? Is this possible?
Thanks!
Last edited by AsHLeX on Mon Dec 11, 2023 8:25 am, edited 1 time in total.

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Adding pause between 'add images' in screen

#2 Post by m_from_space »

AsHLeX wrote: Mon Dec 11, 2023 7:51 am How do I add a pause between 'minigame loops' and 'display the cards'? Is this possible?
Thanks!
There are different methods. One way would be to use a screen variable that determines whether the cards are already shown and make them hide by default. Then add a timer object that shows the cards after a while.

Code: Select all

screen memoria():
    default show_cards = False

    # minigame code

    if show_cards:
        # put your card code here
    else:
        timer 3.0 action SetScreenVariable("show_cards", True)
If you want the screen variable to reset to False when using the memoria screen again, make sure to hide it first.

User avatar
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Re: Adding pause between 'add images' in screen

#3 Post by AsHLeX »

Thank you!! Problem solved :)
Image
New demo out 24/12/23!!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Milkymalk