[SOLVED] Normal NVL Menu in NVL Text Box Frame

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
Bombermans
Newbie
Posts: 13
Joined: Sun Apr 01, 2007 8:27 am
Location: Spain
Contact:

[SOLVED] Normal NVL Menu in NVL Text Box Frame

#1 Post by Bombermans »

Hi, I have a NVL Text Box in my game, as following this tutorial:

So NVL text does show inside a framebox. It works and is scrollable!

Image

However, as it can be seen in the screenshot, the nvl menu choices appear in the center of the screen, and do not appear inside the framebox under the nvl text as it should. I'm guessing the problem is inside the menu part of the screen code, but I don't know how to solve it.

Any help would be appreciated!

Code: Select all

screen nvl:

    #window:
        #style "nvl_window"
    frame:
        xpos 1410 ypos 00
        top_padding 10 bottom_padding 10 left_padding 10 right_padding 10
        has side "c r":
            area (0, 0, 510, 1080)
            viewport id "vp":
                draggable True
                mousewheel True
                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


        # Display a menu, if given.
    if items:
#        frame:
#            xpos 90 ypos 400
#            top_padding 10 bottom_padding 10 left_padding 10 right_padding 10
#            has side "c r":
#                area (0, 0, 200, 150)
                viewport id "menu_vp":
                    vbox:
                        id "menu"

                        for caption, action, chosen in items:

                            if action:

                                button:
                                    style "nvl_button"
                                    action action

                                    text caption style "nvl_menu_choice"

                            else:

                                text caption style "nvl_dialogue"
                #vbar value YScrollValue("menu_vp")

#init -2 python:
    # How far from the left menu choices should be indented.
#    style.nvl_menu_choice_button.left_margin = 1440
Last edited by Bombermans on Mon Dec 11, 2023 7:42 am, edited 1 time in total.

User avatar
Bombermans
Newbie
Posts: 13
Joined: Sun Apr 01, 2007 8:27 am
Location: Spain
Contact:

Re: Normal NVL Menu in NVL Text Box Frame

#2 Post by Bombermans »

YESSS!! I was helped in the discord! Thank you SO MUCH Mr Robot and AxelKong!

So the code is now:

Code: Select all

screen nvl:
    frame:
        xpos 1390 ypos 0
        top_padding 10 bottom_padding 10 left_padding 10 right_padding 10

        has side "c r":
            area (0, 0, 510, 1080)

            viewport id "vp":
                draggable True
                yadjustment ui.adjustment (value=99999, range=99999) # <- idk, just copying your code
                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

                    # and then Display a menu, if given. in the same vbox
                    if items:
                        window:
                            vbox:
                                id "menu"
                                for caption, action, chosen in items:
                                    if action:
                                        button:
                                            style "nvl_menu_choice_button"
                                            action action
                                            text caption style "nvl_menu_choice"
                                    else:
                                        text caption style "nvl_dialogue"

            vbar value YScrollValue("vp") bar_invert True


init -2 python:
     #How far from the left menu choices should be indented.
    style.nvl_menu_choice_button.left_margin = 10
And it works!!!

Post Reply

Who is online

Users browsing this forum: Silac