Questions for nvl menu custom

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
visual00
Regular
Posts: 28
Joined: Fri Aug 22, 2014 8:28 am
IRC Nick: TaeIn
Contact:

Questions for nvl menu custom

#1 Post by visual00 »

hi guys!
I will ask you a question but
I can't speak english very well. I'm sorry
You understanding please

Image
This is nvl menu that I made.

Image
but I want to make something like this.
must be modified which part of my nvl code?
i attached my project & code

Code: Select all


image pini smile = "pini_smile.png"
image bg = im.Scale("classroom1.png", 1280, 720)

define pini = Character('Pini', color="#c8ffc8")
define narrator = Character(None, kind=nvl)

# NVL set-up
init python:
    menu = nvl_menu

    # The color of a menu choice when it isn't hovered.
    style.nvl_menu_choice.idle_color = "#ccccccff"
    
    # The color of a menu choice when it is hovered.
    style.nvl_menu_choice.hover_color = "#ffffffff"

    # The color of the background of a menu choice, when it isn't
    # hovered.
    style.nvl_menu_choice_button.idle_background = im.Scale("unselect.png", 1088, 70)

    # The color of the background of a menu choice, when it is
    # hovered.
    style.nvl_menu_choice_button.hover_background = im.Scale("select.png", 1088, 70)

    # How far from the left menu choices should be indented.
    style.nvl_menu_choice_button.left_margin = 20

    # Set the background of the NVL window; this image should be the
    # same size as the screen.
    style.nvl_window.background = "largeTextArea.png"

    # Add some additional padding around the contents of the NVL window.
    # This keeps the text inside the borders of our image.
    style.nvl_window.xpadding = 55
    style.nvl_window.ypadding = 55

    config.empty_window = nvl_show_core
    config.window_hide_transition = dissolve
    config.window_show_transition = dissolve


# game start 
label start:

    scene bg
    
    show pini smile

    pini "You've created a new Ren'Py game."

    pini "Once you add a story, pictures, and music, you can release it to the world!"
    
    hide pini smile
    
    menu:
        "nvl menus...
       \nblah blah blah blah 
       \nblah blah blah blah
       \nblah blah blah........
       \nchoose!"

        "choose1":
            $ chose = 1
        "choose2":
            $ chose = 2
        "choose3":
            $ chose = 3

    show pini smile

    pini "you're choose [chose] !!!" 

    return
Attachments
nvl_menus_coustomizing_Test.zip
(3.59 MiB) Downloaded 56 times

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Questions for nvl menu custom

#2 Post by philat »

Code: Select all

init python:
    style.nvl_menu_choice.xalign = 0.5 ###
    style.nvl_menu_choice.ypos = 10 ###

screen nvl(dialogue, items=None):

    window:
        style "nvl_window"

        has 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

        # Display a menu, if given.
        if items:

            vbox:
                spacing 30 ###
                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"
Added the lines with hashtags. Looks like this.
Attachments
screenshot0001.png

User avatar
visual00
Regular
Posts: 28
Joined: Fri Aug 22, 2014 8:28 am
IRC Nick: TaeIn
Contact:

Re: Questions for nvl menu custom

#3 Post by visual00 »

philat wrote:

Code: Select all

init python:
    style.nvl_menu_choice.xalign = 0.5 ###
    style.nvl_menu_choice.ypos = 10 ###

screen nvl(dialogue, items=None):

    window:
        style "nvl_window"

        has 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

        # Display a menu, if given.
        if items:

            vbox:
                spacing 30 ###
                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"
Added the lines with hashtags. Looks like this.

Really nice I solved the problem

thank you very very very much !!!!!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]