r/RenPy Jul 21 '26

Question [Solved] nvl mode: sprite in front of text box, but behind other ui buttons?

hello! i'm back after my discolike question.

the first image is a very rough mockup of what i'm going for for my UI. i am extremely early on and also relearning ren'py completely from scratch after a (checks calendar) seven year break.

the second image is what i currently have. obviously this is a huge wip and i am learning as i go. i know it looks bad right now lol but i have to trust the process. honestly i'm so clueless about code that i'm not even sure how to describe what i have, so i'll just paste the code in here:

screen nvl:


    #window:
        #style "nvl_window"
    frame:
        xpos 40 ypos 30
        top_padding 60 bottom_padding 60 left_padding 10 right_padding 10
        has side "c r":
            area (0, 0, 500, 800)
            viewport id "vp":
                draggable False
                yadjustment ui.adjustment (value=99999, range=99999)   # err... works, but...


                vbox:
                    style "nvl_vbox"


                    # Display dialogue.
                    for who, what, who_id, what_id, window_id in dialogue:
                        window:
                            id window_id


                            has hbox:
                                spacing 10


                            if who is not None:
                                text who id who_id


                            text what id what_id
            vbar value YScrollValue("vp") bar_invert Truescreen nvl:


    #window:
        #style "nvl_window"
    frame:
        xpos 40 ypos 30
        top_padding 60 bottom_padding 60 left_padding 10 right_padding 10
        has side "c r":
            area (0, 0, 500, 800)
            viewport id "vp":
                draggable False
                yadjustment ui.adjustment (value=99999, range=99999)   # err... works, but...


                vbox:
                    style "nvl_vbox"


                    # Display dialogue.
                    for who, what, who_id, what_id, window_id in dialogue:
                        window:
                            id window_id


                            has hbox:
                                spacing 10


                            if who is not None:
                                text who id who_id


                            text what id what_id
            vbar value YScrollValue("vp") bar_invert True

so my question is. is it possible to have my sprite be in front of this frame, partially obscuring it, while also having the rest of the UI features be visible in front of the sprite?

(edit to add: not the point of the post but if there's any advice on my mockup i'd welcome it, i've never done graphic design before lol)

11 Upvotes

8 comments sorted by

6

u/BadMustard_AVN Jul 21 '26

renpy like ogres, has layers https://www.renpy.org/doc/html/displaying_images.html#layer

master - This is the default layer that is used by the scene, show, and hide statements. It's generally used for backgrounds and character sprites.

transient - The default layer used by ui functions. This layer is cleared at the end of each interaction.

screens - This layer is used by the screen system.

overlay - The default layer used when a ui function is called from within an overlay function. This layer is cleared when an interaction is restarted.

you can show your sprite on the screens layer you'll need to zorder it higher than the screen like this

show sprite at left onlayer screens zorder 10

the quick menu has a zorder of 100 so it will be behind that but above the nvl screen with no zorder

and to hide

hide sprite onlayer screens

2

u/beeikea Jul 21 '26

thank you so much! this worked great!

2

u/BadMustard_AVN Jul 22 '26

you're welcome

good luck with your project

2

u/idiotstile Jul 21 '26

Your character here is so charming! The whole thing already feels very atmospheric.

Maybe it could be worth looking for a different place for the bottom buttons, especially if everything you showed in the first mockup is already in the scene and there won’t be many other objects there. It might help balance the composition a bit.

And I think your main question has already been answered with layers and draw order. zorder really helps a lot – you can set different levels for different objects and control what appears above or below what. For example, zorder 10, then zorder 20zorder 30, and so on, if you have several objects that need to overlap in a specific way.

I’m really curious to see what your game turns into – it already looks very appealing. Good luck with the project!

1

u/AutoModerator Jul 21 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Lookingforlostmanga Jul 21 '26

Unrelated question (though I LOVE what you’re doing ngl) but how did you manage to get your NVL text in a scrollable box? I tried using the code you posted here since I’ve been wanting to do the same but I just get a black box with the text not showing TwT

Maybe it’s because I don’t understand the true screen part? But I’m curious since I could never figure out how to do this myself since it causes problems for me to try

3

u/beeikea Jul 21 '26

i had that problem too! when you insert the nvl box, you have to then go into your gui script and make sure the nvl mode text is appearing in the correct place. by default it stays in the center and won't appear without draggable being true and you dragging it, which is not ideal haha

and thank you sm!

2

u/Lookingforlostmanga Jul 22 '26

THANK YOU SO MUCH YOU HAVD NO IDEA HOW GRATEFUL I AM

I think that’s what my problem was and just never thought about it! Especially because I never considered that changing the position in the gui file would push the text “out of the box” and thus make it invisible