Showing one screen hides another 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
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Showing one screen hides another screen[SOLVED]

#1 Post by TellerFarsight »

I have a button in the quick menu like this:

Code: Select all

screen quick_menu():
    zorder 100
    tag menu

    if quick_menu:
        imagemap:
            auto "gui/QuickMenu_%s.png"
            alpha False
            hotspot (221, 8, 39, 34) action Preference("auto-forward", "toggle")
            hotspot (265, 8, 39, 34) action Skip() alternate Skip(fast=True, confirm=True)
            hotspot (308, 8, 39, 34) action ShowMenu('history')
            if at_checkpoint:
                hotspot (380, 4, 52, 36) action ShowMenu('phone_menu')
The last button there goes to another screen called the phone menu:

Code: Select all

screen phone_menu():
    tag menu
    imagemap:
        auto "gui/PhoneMenu_%s.png"
        yalign 1.0
        alpha False
        hotspot (64, 348, 92, 116) action QuickSave()
        hotspot (176, 348, 92, 116) action ShowMenu('preferences')
        hotspot (288, 348, 92, 116) action Return()
Now, the problem is with another screen I have called the hud, which is displayed during dialogue and has the quick menu sitting on top of it. When I click the button to go to the phone menu, it brings up the phone menu but hides the hud screen. The phone menu is smaller than the screen, so the image doesn't actually cover up the hud screen. The hud screen is being hidden, but I want it not to.

Code: Select all

screen hud():
    style_prefix "hud"
    add "images/HUDstuff/HUD.png"
    add "ticker"
    add "colon"
Attachments
This is the phone menu, and the black bar at the top is actually an area of full transparency. It's black just because the image behind it is black, so if I showed an image there it would be visible. I want the hud screen to be visible through the hole in the phone menu
This is the phone menu, and the black bar at the top is actually an area of full transparency. It's black just because the image behind it is black, so if I showed an image there it would be visible. I want the hud screen to be visible through the hole in the phone menu
This is the regular screen, with the bar at the top being the hud screen, and the circle thing on the hud is the button that goes to the phone menu
This is the regular screen, with the bar at the top being the hud screen, and the circle thing on the hud is the button that goes to the phone menu
Last edited by TellerFarsight on Mon Jun 26, 2017 11:32 am, edited 1 time in total.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Showing one screen hides another screen

#2 Post by Ocelot »

IIRC ShowMenu hides all other screens. Try to use Show instead.
< < insert Rick Cook quote here > >

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Showing one screen hides another screen

#3 Post by TellerFarsight »

I tried that, but then the menu just didn't show up at all.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Showing one screen hides another screen

#4 Post by Milkymalk »

Did you try "Show" with capital S? It's an action instead of a script statement, so you need to capitalize the first letter.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Showing one screen hides another screen

#5 Post by TellerFarsight »

Yeah, and the phone menu didn't show up. It looked like the circle button just became a null action button. It's not because of the menu tags either because the two screens in question have different tags, and it's not because of zorder because that shouldn't affect a screen with a transparent hole in it.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Showing one screen hides another screen

#6 Post by Milkymalk »

Could "alpha False" in the phone menu be at fault? Not sure what it does, but as you said the black bar is supposed to be transparent and transparency is made via alpha channel, this sounds like a possibility.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Showing one screen hides another screen

#7 Post by TellerFarsight »

No, alpha here is about the hover area of the buttons, it doesn't affect the transparency of the top bar. It's showing black because the background image behind it is black up there.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Showing one screen hides another screen

#8 Post by DannyGMaster »

Try the 'use' statement. In your quick_menu:

Code: Select all


default phone_on = False

screen quick_menu():
    zorder 100
    tag menu

    if quick_menu:
        if phone_on == True:
            use phone_menu()
        imagemap:
            auto "gui/QuickMenu_%s.png"
            alpha False
            hotspot (221, 8, 39, 34) action Preference("auto-forward", "toggle")
            hotspot (265, 8, 39, 34) action Skip() alternate Skip(fast=True, confirm=True)
            hotspot (308, 8, 39, 34) action ShowMenu('history')
            if at_checkpoint:
                hotspot (380, 4, 52, 36) action SetVariable('phone_on', True)
In theory (can't test without all those images) use should show the screen without hiding any other screen.
The silent voice within one's heart whispers the most profound wisdom.

User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Re: Showing one screen hides another screen

#9 Post by vollschauer »

Don't use:

Code: Select all

tag menu
in your quick_menu/phone_menu

try to use:

Code: Select all

modal True
and use:

Code: Select all

... action Show('phone_menu')

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Showing one screen hides another screen

#10 Post by TellerFarsight »

That works! I had tried something similar before, but I had gone in the wrong direction; I was trying to have the phone_menu screen use the hud screen, your solution is better.

Any idea how to make the new screen come in with a fade or dissolve?
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Showing one screen hides another screen

#11 Post by TellerFarsight »

vollschauer, that also worked in fixing the display problem, but the phone_menu is also an imagemap, and using modal makes it so I can't interact with it.

Edit: Ok, I don't know what I did wrong last time but I tried your solution again and it worked. Thanks for your help everyone!
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

Post Reply

Who is online

Users browsing this forum: Google [Bot]