Showing two screens at the same time? [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:

Showing two screens at the same time? [SOLVED]

#1 Post by AsHLeX »

So basically I have an imagemap and an imagebutton which calls an information screen in-game (that doesn't cover up the whole screen)

Imagemap:

Code: Select all

# Bedroom
screen weekday_morning:
    key "dismiss" action [[]]
    imagemap:
        ground "BG/Hiro's Bedroom.png"
        hover "BG/Hiro's Bedroom w.png"
        
        hotspot (192,375,100,100) clicked Jump("sleep_in")
        hotspot (409,482,100,100) clicked Jump("morning_out")
Imagebutton:

Code: Select all

screen open_information:
    vbox xalign 1.0 yalign 0.0:
        textbutton "Stats" action Show("aff_screen")
Information Screen:

Code: Select all

screen aff_screen:
    frame:
        yalign 0.0
        xalign 0.5
        vbox:
            label "Statistics" xalign 0.5
            hbox:
                label "Intelligence" xminimum 150
                bar range int_max value int_pt xmaximum 400
            hbox:
                label "Fitness" xminimum 150
                bar range fit_max value fit_pt xmaximum 400
            hbox:
                label "Social" xminimum 150
                bar range soc_max value soc_pt xmaximum 400
            hbox:
                label "Art" xminimum 150
                bar range art_max value art_pt xmaximum 400
            hbox:
                label "Stress" xminimum 150
                bar range stress_max value stress_pt xmaximum 400
            hbox:
                xalign 0.5
                textbutton "{size=18}Return{/size}" action Hide("aff_screen")

Code: Select all

label start:
    show screen weekday_morning 
    show screen open_information
    return
but doing this won't work because the game will just return to the main menu again.
But if I call the screen weekday_morning, then it will be over the screen open_information (meaning I can't see the imagebutton.)

Can anyone point me in the right direction, please?

Thanks for reading ^_^
And thank you in advance. ^^"
Last edited by AsHLeX on Wed May 27, 2015 2:46 am, edited 1 time in total.

User avatar
orz
Regular
Posts: 126
Joined: Tue Apr 21, 2015 10:19 pm
Contact:

Re: Showing two screens at the same time?

#2 Post by orz »

"show" simply displays the screen. It doesn't wait before moving on.

So what's happening there is it puts up the first screen quickly, then also puts up the second screen at the same time, then hits the return and exits to main menu before you notice it.

If you use "call" it'll wait for input, however.

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: Showing two screens at the same time?

#3 Post by AsHLeX »

But if i use call one screen will override the other. And I'll only have 1 screen
Image
New demo out 24/12/23!!

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Showing two screens at the same time?

#4 Post by trooper6 »

You could try having the first screen use the second screen and see if that works.
Use is a keyword documented here: http://www.renpy.org/doc/html/screens.html#use
I have used use before and it works well...mostly in my main menu screen...you know, if they've completed the game use this extra screen with extra secret buttons.

I'm on my iPad so I can't build a test example, but you could try that out.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
orz
Regular
Posts: 126
Joined: Tue Apr 21, 2015 10:19 pm
Contact:

Re: Showing two screens at the same time?

#5 Post by orz »

You could also try using "show" on the first screen and using "call" on the second screen so it stops for input there.

Just make sure the second screen being called is "modal False" so you can click on the other screen.

So in essence what will happen is the first screen is called, like a transparent sheet, and the second screen is laid right on top of the first one. Then the program waits for input.

User avatar
Alera
Miko-Class Veteran
Posts: 651
Joined: Sun Mar 21, 2010 3:20 am
Completed: Tortichki // Zayay // Hero's Spirit
Deviantart: psyalera
itch: psyalera
Location: UK
Contact:

Re: Showing two screens at the same time?

#6 Post by Alera »

Just another suggestion but what about using ui.interact? That way you can show as many screens as you want and this will prevent the player from being able to simply click and skip the screens.


Something like this:

Code: Select all

label start:
    show screen weekday_morning 
    show screen open_information
    python:
        ui.interact()
    return
Image
Games:
❤️ Zayay [Otome?][BxPlayer][NaNo 2013]
❤️ Tortichki [Drag&Drop mini game]

Other games I've worked on:
My Heart's Flame Emissary of Starlight Freedom From Silence Sickness
And many more unannounced/secret projects. (. .)

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: Showing two screens at the same time?

#7 Post by AsHLeX »

Solved!! Thank you so much trooper6, orz and Alera!! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot]