[SOLVED] Menu hides 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
nananame
Regular
Posts: 66
Joined: Fri Oct 13, 2017 1:40 pm
Contact:

[SOLVED] Menu hides screens

#1 Post by nananame » Fri Sep 25, 2020 9:34 am

I have a game menu which opens in the middle of the screen, leaving the rest of the game visible. I just noticed that when the game menu appears it hides the screens currently shown. I'm guessing this is because the game menu when called through ShowMenu is called in a new context?

Is there a way around this? I don't think the solution would be to call the game menu with the Show action instead of ShowMenu action because if we are in the same context gameplay continues and a save screenshot will also make a screenshot of the gamemenu itself. So I do want the game menu to be in new context (pause current gameplay) just not hide the screens already shown. Doable?
Last edited by nananame on Fri Sep 25, 2020 11:51 am, edited 1 time in total.

User avatar
RicharDann
Veteran
Posts: 239
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Menu hides screens

#2 Post by RicharDann » Fri Sep 25, 2020 10:44 am

You can use Show action instead of ShowMenu, if you want other screens to stop receiving input add modal True clause to your screen:

Code: Select all

screen my_game_menu():
    modal True
Just make sure your screen also has some way for the player to quit it once they want to continue the game, like adding a button or setting a key (like the right mouse button) with a Hide('my_game_menu') action.
The most important words a man can say are, “I will do better.”

User avatar
Remix
Eileen-Class Veteran
Posts: 1506
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Menu hides screens

#3 Post by Remix » Fri Sep 25, 2020 11:10 am

If you are okay with those screens being visible on any game menu you could remove the screens layer from config.context_clear_layers

define config.context_clear_layers = [ 'screens' ]

A list of layers that are cleared when entering a new context.
Frameworks & Scriptlets:

nananame
Regular
Posts: 66
Joined: Fri Oct 13, 2017 1:40 pm
Contact:

Re: Menu hides screens

#4 Post by nananame » Fri Sep 25, 2020 11:51 am

Remix wrote:
Fri Sep 25, 2020 11:10 am
If you are okay with those screens being visible on any game menu you could remove the screens layer from config.context_clear_layers

define config.context_clear_layers = [ 'screens' ]

A list of layers that are cleared when entering a new context.
That's what I was looking for! Thanks!

Post Reply

Who is online

Users browsing this forum: djinius, drbugs, sousarja