Changing choice menu to embed it in the NVL window.

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
Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Changing choice menu to embed it in the NVL window.

#1 Post by Scott »

Is it possible to make the choice menu show up as part of the normal text in the NVL window rather than displaying two buttons on a blank screen? If it's possible, could you give me some advice or an example, please?

I looked at ui.menu, but there's no example there (yet).

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Changing choice menu to embed it in the NVL window.

#2 Post by PyTom »

Yes. To do this, you need two steps:

1) Set button_menu = False in the call to theme.roundrect in options.rpy.
2) Add to your game the following code:

Code: Select all

init:
    $ menu = nvl_menu
You want to follow each menu with "nvl clear", since the menu doesn't get put into the NVL buffer.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Re: Changing choice menu to embed it in the NVL window.

#3 Post by Scott »

Looks like that did the trick. Is there a way to style it? I tried style.nvl_menu, but with no luck... I'd like to change the text color, highlight color, and x positioning... I'd also like to be able to change where the highlight begins so that it highlights only the text of the choice rather than the number plus the text.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Changing choice menu to embed it in the NVL window.

#4 Post by PyTom »

I forget what the style is, but there's an easy way to find out. Hover over the menu, and hit shift+I to call up the style inspector... it should tell you what the styles are.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Re: Changing choice menu to embed it in the NVL window.

#5 Post by Scott »

Looking at the focus properties... it looks like it's impossible to have a highlight that covers just the text, since the length of the text varies between menu points. Am I correct, or am I missing something?

Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Re: Changing choice menu to embed it in the NVL window.

#6 Post by Scott »

So, just a bump... is it possible to change the highlight color and make it variable width so that it only covers the area of the text for the option?

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Changing choice menu to embed it in the NVL window.

#7 Post by PyTom »

IIRC, you could do it perhaps by setting style.nvl_menu_choice_button.xfill to False/

This would work so long as the menu choice is one line long.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Google [Bot]