[Solved] Problem showing screens.

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
K-PSZH
Regular
Posts: 37
Joined: Sun May 15, 2022 10:34 am
Soundcloud: K-PSZH
Location: Russia
Contact:

[Solved] Problem showing screens.

#1 Post by K-PSZH »

Good day everyone.
So, now my code is looks approximately like this:

Code: Select all

label start:
    with Fade(1.0, 0.5, 1.0)
    ###
    call screen screen1 with dissolve

Code: Select all

screen screen1:
    add "gui/game_menu.png"
    add "gui/screen1/map_bg.png"
    imagebutton auto "gui/button/choice_L_%s.png" at button_choice:
        action Show("screen2")
        xpos -0.24
        ypos 0.05
        activate_sound "audio/sfx/menu_click.wav"
        hover_sound "audio/sfx/menu_hover.wav"

screen screen2:
    add "gui/screen2/map.png" at map_appear
    imagebutton auto "gui/screen2/tolabel_%s.png":
        action Jump("label2")
        xpos 0.48
        ypos 0.76
        activate_sound "audio/sfx/menu_click.wav"
        hover_sound "audio/sfx/menu_hover.wav"
Yes, I need the both screens show in the same time.
The problem is when "screen2" jumps to "label2", "screen1" is disappears, but "screen2" is not. How can I fix it?
Last edited by K-PSZH on Sun May 22, 2022 5:38 am, edited 1 time in total.
Missing/forgetting a lot of simplest things and ask about them here.

User avatar
Andredron
Miko-Class Veteran
Posts: 719
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Problem showing screens.

#2 Post by Andredron »

Code: Select all

screen screen2:
    add "gui/screen2/map.png" at map_appear
    imagebutton auto "gui/screen2/tolabel_%s.png":
        action [Jump("label2"),Hide("screen2")] 
        xpos 0.48
        ypos 0.76
        activate_sound "audio/sfx/menu_click.wav"
        hover_sound "audio/sfx/menu_hover.wav"
And:

viewtopic.php?f=51&t=55300

User avatar
K-PSZH
Regular
Posts: 37
Joined: Sun May 15, 2022 10:34 am
Soundcloud: K-PSZH
Location: Russia
Contact:

Re: Problem showing screens.

#3 Post by K-PSZH »

Hide doesn't work for me - screen2 is still here after jumping.
But I'll try that thing from link.
Missing/forgetting a lot of simplest things and ask about them here.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Problem showing screens.

#4 Post by rayminator »

this should work try not to put numbers inside a screen/label names it can through renpy off a bit

Code: Select all

screen screen_one:
    add "gui/game_menu.png"
    add "gui/screen1/map_bg.png"
    imagebutton:
        auto "gui/button/choice_L_%s.png" at button_choice       
        xpos -0.24
        ypos 0.05
        activate_sound "audio/sfx/menu_click.wav"
        hover_sound "audio/sfx/menu_hover.wav"
        action [Hide("screen_one"), Show("screen_two")

screen screen_two:
    add "gui/screen2/map.png" at map_appear
    imagebutton:    
        auto "gui/screen2/tolabel_%s.png"    
        xpos 0.48
        ypos 0.76
        activate_sound "audio/sfx/menu_click.wav"
        hover_sound "audio/sfx/menu_hover.wav"
        action [Hide("screen_two"), Call("two")]

label two:
     "blah"

User avatar
K-PSZH
Regular
Posts: 37
Joined: Sun May 15, 2022 10:34 am
Soundcloud: K-PSZH
Location: Russia
Contact:

Re: Problem showing screens.

#5 Post by K-PSZH »

rayminator wrote: Sat May 21, 2022 3:21 pm this should work try not to put numbers inside a screen/label names it can through renpy off a bit
Naah, still doesn't works for me. I'll try better to rework system that in my minds of create.
Missing/forgetting a lot of simplest things and ask about them here.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Problem showing screens.

#6 Post by rayminator »

I have recreated what you are trying to do it's working just fine for

Code: Select all

label start:
    call screen test_one

    return

screen test_one:
    add "images/fsm_trolley01.png"
    imagebutton:
        idle "images/Alice1.png"
        hover "images/Alice1.png"
        action [Hide("test_one"), Show("test_two")]

screen test_two:
    add "images/fsm_trolley01.png"
    use test_one
    imagebutton:
        idle "images/Ann1.png"
        hover "images/Ann1.png"
        xalign 0.5
        action [Hide("test_two"), Jump("two")]

label two:
    "test"
    return

User avatar
K-PSZH
Regular
Posts: 37
Joined: Sun May 15, 2022 10:34 am
Soundcloud: K-PSZH
Location: Russia
Contact:

Re: Problem showing screens.

#7 Post by K-PSZH »

rayminator wrote: Sat May 21, 2022 5:03 pm I have recreated what you are trying to do it's working just fine for
Hell yeah, it's working now! It seems the problem was the order of actions, firstly it needs to hide, and after that label is shown. Thanks!
Missing/forgetting a lot of simplest things and ask about them here.

Post Reply

Who is online

Users browsing this forum: No registered users