Order of textbox, namebox and side image

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
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Order of textbox, namebox and side image

#1 Post by Lezalith » Wed Aug 31, 2016 5:40 am

Hey everyone, I hope you're having an amazing day.

So, it is pretty much known at things that are on line 10 will get covered up by something on line 20. The further down the code, the closer to the player. Now, I'm having a little trouble with implementing a namebox.

Code: Select all

screen say(who, what, side_image=None, two_window=True):
    vbox:
        style "say_two_window_vbox"

        window:
            id "window"

            has vbox:
                style "say_vbox"
            text what:
                id "what" 
        if who:
            window:
                frame:
                    background "GUI/Textbox/oyoa_namebox.png"
                    xpos -10
                    ypos 625
                    text who:
                        xpos 15
                        ypos 45
                        id "who"
This is the code. It is not the default code for Say screen, it is little editted.
Now, the namebox of course is the part that starts with "if who:". What I need is for that namebox to be IN FRONT OF the textbox.
This should work, but what it does instead is not show the namebox at all.

If I was to switch the code like this...

Code: Select all

screen say(who, what, side_image=None, two_window=True):
    vbox:
        style "say_two_window_vbox" 
        if who:
            window:
                frame:
                    background "GUI/Textbox/oyoa_namebox.png"
                    xpos -10
                    ypos 625
                    text who:
                        xpos 15
                        ypos 45
                        id "who"

        window:
            id "window"

            has vbox:
                style "say_vbox"
            text what:
                id "what" 
Then I will be able to see the namebox, but it's on top of the namebox, which is not what I want.

While writing this, I realized I also could take that whole "if who:" out of the vbox. This didn't do anything and acted like in the first case.

User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Re: Order of textbox, namebox and side image

#2 Post by vollschauer » Wed Aug 31, 2016 6:19 am

Try:

Code: Select all

    vbox:
        style "say_two_window_vbox" 
        order_reverse True # the name box in front of the text window

User avatar
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Re: Order of textbox, namebox and side image

#3 Post by Lezalith » Wed Aug 31, 2016 6:53 am

Actually worked! Thank you! :3

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_