How to properly show multiple screens simultaneously

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
TeachMeHowToCodee
Newbie
Posts: 7
Joined: Fri Nov 12, 2021 10:52 pm
Contact:

How to properly show multiple screens simultaneously

#1 Post by TeachMeHowToCodee »

Hiya. I'm currently displaying multiple screens at the same time (involving a hud with a map for the 1st screen and a background with clickable objects for the 2nd) using this method:

Code: Select all

label showingscreen:
	show screen1
	call screen2
And I've also tried using this one:

Code: Select all

label showingscreen:
	show screen1
	show screen2
	python:
		ui.interact()
It works mostly fine except when I try to save because everytime I right click or press escape, it returns me to the label before this one.
(i.e: If I was in label room1 for example and I jump to this label and click the map and go to label room2[which works fine], but when I press escape it returns me back to label room1 for some reason)

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: How to properly show multiple screens simultaneously

#2 Post by zmook »

Are there buttons in screen1 that do action Return()? That might cause your problem, because you're only 'show'ing screen1, so executing a Return will probably pop something unexpected off the stack.

If that's not it, we're probably going to need to see a bunch more of your code to be able to guess what's going on.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

TeachMeHowToCodee
Newbie
Posts: 7
Joined: Fri Nov 12, 2021 10:52 pm
Contact:

Re: How to properly show multiple screens simultaneously

#3 Post by TeachMeHowToCodee »

No there's nothing like that really. For my screens I do it like this:

Code: Select all

screen a:
	imagebutton auto "screen_a_%s":
		focus_mask True
		action ShowMenu("screen b")

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: How to properly show multiple screens simultaneously

#4 Post by zmook »

Could you post some more of your actual code? I don't understand what you're doing or why you're doing it that way.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

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

Re: How to properly show multiple screens simultaneously

#5 Post by rayminator »

there is a lot of ways of doing this

create a screen called mainUI and put this code

if you want to add more you can and you can also use varible and if/elif/else statements

Code: Select all

screen mainUI():
    use button_task_overlay
    use Character_Screen
    use clock_screen
    use TopBar
open screens.rpy find screen say(who, what): and put this on a new line use mainUI

choice 1:

Code: Select all

screen say(who, what):
    use mainUI
    style_prefix "say"
or you can put this use label start: like this

choice 2:

Code: Select all

label start:
    $ renpy.call_screen("mainUI")

Post Reply

Who is online

Users browsing this forum: No registered users