Permanent root screen for ingame content that stays when say/nvl text boxes disappear

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
komehara
Regular
Posts: 36
Joined: Fri Jan 31, 2020 10:08 pm
Projects: Spirit Link
Tumblr: hsandt
Deviantart: hsandt
Github: hsandt
itch: komehara
Contact:

Permanent root screen for ingame content that stays when say/nvl text boxes disappear

#1 Post by komehara »

I want to add a permanent frame to my game. It may apply to the whole game (main menu, game menu, ingame) but for now I want at least to cover the ingame.

However, I could find no ingame root screen, unlike main_menu and game_menu. Since my game used NVL mode, the closest I could find was the nvl screen, but it disappears when the nvl box disappears.

Attachments:
- screenshot 1 shows what I want with a frame around the whole screen
- screenshot 2 shows what happens if I stop using the default narrator (in my case, nvl_narrator): the frame disappears
2023-11-11 NVL frame 1 - it works but.png
(256.72 KiB) Not downloaded yet
How can I make the frame stick around for at least the whole ingame part? (then I could add it to main_menu and game_menu to make it stay for the whole game)

Should I add some Renpy/Python action to `show` the frame image on game start, then remove it on game end? It seems more elegant to use the available screens.

User avatar
plastiekk
Regular
Posts: 112
Joined: Wed Sep 29, 2021 4:08 am
Contact:

Re: Permanent root screen for ingame content that stays when say/nvl text boxes disappear

#2 Post by plastiekk »

komehara wrote: Sat Nov 11, 2023 11:38 am I want to add a permanent frame to my game.
I would try it with a function, depending on the condition of a variable displays the screen or not (there may be situations in which you don't want to display the image/frame).

Code: Select all

init python:
    def overlay_frame():
        if show_myframe:
            renpy.show_screen("always_frame", _layer= "master")
        else:
            renpy.hide_screen ("always_frame", _layer= "master")    
        return

    config.overlay_functions.append(overlay_frame)
    
default show_myframe = True         # set to false to not show the frame


screen always_frame():
    ## not sure if you even need the frame option for this
    frame:  
        add "the_image_name"

    
label start:
    $ show_myframe = True
    "Here we show the frame"
    $ show_myframe = False
    "An here we don't show it"
    return
Why on earth did I put the bread in the fridge?

User avatar
komehara
Regular
Posts: 36
Joined: Fri Jan 31, 2020 10:08 pm
Projects: Spirit Link
Tumblr: hsandt
Deviantart: hsandt
Github: hsandt
itch: komehara
Contact:

Re: Permanent root screen for ingame content that stays when say/nvl text boxes disappear

#3 Post by komehara »

Thanks, so using a screen would give me more control.

In the meantime I tried something simple: just show the image (on a custom layer above screens) on script start, and just let it for the rest of the game. It's working well so far.

If I need to hide it dynamically without having to call hide statements each time, I'll try the screen method.

Post Reply

Who is online

Users browsing this forum: No registered users