Page 3 of 3

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Nov 22, 2016 4:00 pm
by Ryue
As the new gui has one bug finally eliminated (multiline nvl texts now no longer crush the layout!), I need to use the new gui^^.

Important things in the new gui:

Screens.rpy:

Code: Select all

define config.nvl_list_length = 6 # How many nvl lines will be displayed max.
Gui.rpy:

Code: Select all

# The borders of the background of the NVL-mode background window.
define gui.nvl_borders = Borders(0, 10, 0, 20)

## The height of an NVL-mode entry. Set this to None to have the entries
## dynamically adjust height.
define gui.nvl_height = 115

## The spacing between NVL-mode entries when gui.nvl_height is None, and between
## NVL-mode entries and an NVL-mode menu.
define gui.nvl_spacing = 10

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.nvl_name_xpos = 430
define gui.nvl_name_ypos = 0
define gui.nvl_name_width = 150
define gui.nvl_name_xalign = 1.0

## The position, width, and alignment of the dialogue text.
define gui.nvl_text_xpos = 450
define gui.nvl_text_ypos = 8
define gui.nvl_text_width = 590
define gui.nvl_text_xalign = 0.0

## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 240
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 780
define gui.nvl_thought_xalign = 0.0

## The position of nvl menu_buttons.
define gui.nvl_button_xpos = 450
define gui.nvl_button_xalign = 0.0
define gui.nvl_height = None is something of a must if you want to use says with different number of lines (as else all lines will have a height displayed as the one with the maximum number of lines has).

With nvl_height = 115 it would look like this:
Image
With nvl_height = None it would look like this:
Image


I'm lazy myself but I HATE to use code I don't understand so even for tutorials like yours I usually do one and only one thing first: I try to understand them (aka what is done how and why) and then I do it myself^^'
(Maybe programmers pride, maybe old school, no clue why in essence I do it that way but that is me^^')

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Nov 22, 2016 4:09 pm
by OokamiKasumi
Ryue wrote:As the new gui has one bug finally eliminated (multiline nvl texts now no longer crush the layout!), I need to use the new gui^^.
AWESOME! And very useful.
-- I've added the links to both your entries to the first page for those using the New GUI style.

Can you add a Screenshot to your entry(s) to show the readers what the results look like?

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Nov 22, 2016 4:16 pm
by Ryue
OokamiKasumi wrote:
Ryue wrote:As the new gui has one bug finally eliminated (multiline nvl texts now no longer crush the layout!), I need to use the new gui^^.
AWESOME! And very useful.
-- I've added the links to both your entries to the first page for those using the New GUI style.

Can you add a Screenshot to your entry(s) to show the readers what the results look like?
You mean the =None? can do that.

For the other entries: they are the default entries in the appropriate files.

I edited the post I made and added the screenshots.

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Nov 22, 2016 4:19 pm
by OokamiKasumi
Ryue wrote:
OokamiKasumi wrote:Can you add a Screenshot to your entry(s) to show the readers what the results look like?
You mean the =None? can do that.
Thanks!
Ryue wrote:For the other entries: they are the default entries in the appropriate files.
Got'cha.
Ryue wrote:I edited the post I made and added the screenshots.
It looks great, thank you!
Ryue wrote:I'm lazy myself but I HATE to use code I don't understand so even for tutorials like yours I usually do one and only one thing first: I try to understand them (aka what is done how and why) and then I do it myself^^'
(Maybe programmers pride, maybe old school, no clue why in essence I do it that way but that is me^^')
I'm the same way, I also don't like using code I don't understand. (That's just begging for errors I have no clue how to fix.) What I do is make sample games to work out how blocks of code work. Once I figure out how to get them to run properly, I just copy-paste the code from the samples into the games I'm actually trying to make. As they say: "Practice makes...better."

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Jan 03, 2017 9:05 pm
by Georgel
Is it possible to change the default behavior of window where the window hides during animations if nvl was used in the game?

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Apr 04, 2017 4:27 pm
by IndieAuthor
I know. I'm late ... but what about WIDTH .... I'd like to have my NVL box cover only about 50% of the screen

Re: [Tutorial] Customizing the NVL Textbox

Posted: Sun May 14, 2017 12:34 am
by willanik
IndieAuthor wrote:I know. I'm late ... but what about WIDTH .... I'd like to have my NVL box cover only about 50% of the screen
Hey IndieAuthor, a late reply to your question. In a different program I make a custom nvl background box (e.g. a coloured rectangle as a png file). When I make it I set its dimensions to the height and width that I want. So if I am working with 1920 by 1280 in Ren’py and want the nvl box to cover half the screen, I set its width to be 960.

Now, a question of my own. I can vary the position of the NVL text, using the guide from earlier in this thread. But I also want to vary the position of the nvl background box. The default for my nvl background is the upper left corner of the page; how can I move it down and to the right a little so that it does not site hard against the corner of the page?

Thanks,
W

Re: [Tutorial] Customizing the NVL Textbox

Posted: Sat Apr 25, 2020 3:27 am
by noeinan
Thanks so much for this guide! It's been really helpful as I'm using nvl mode for the first time in a game I'm working on.

Regarding the new code, I've run into a bit of an issue and was wondering if anyone had some insight?
Ryue wrote: Tue Nov 22, 2016 4:00 pm
Gui.rpy:

Code: Select all

## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 240
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 780
define gui.nvl_thought_xalign = 0.0

Here, I'm wanting my nvl text to start a bit lower on the screen so I changed gui.nvl_thought_ypos to 150. However, when I do that, it is also adding 150px spacing between lines! Even though I've set gui.nvl_spacing to only 10. It seems to me that it should be spacing normally, but just starting the text 150px lower? Here's the exact code, any help is much appreciated!

Code: Select all

init python:

## ---- No Frame (non-adjustable) Nvl Box------
    style.nvl_window.background = "gui/nvl.png"

define config.nvl_list_length = 6 # How many nvl lines will be displayed max.

## The height of an NVL-mode entry. Set this to None to have the entries
## dynamically adjust height.
define gui.nvl_height = None

## The spacing between NVL-mode entries when gui.nvl_height is None, and between
## NVL-mode entries and an NVL-mode menu.
define gui.nvl_spacing = 10

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.nvl_name_xpos = 1140
define gui.nvl_name_ypos = 0
define gui.nvl_name_width = 150
define gui.nvl_name_xalign = 1.0

## The position, width, and alignment of the dialogue text.
define gui.nvl_text_xpos = 1160
define gui.nvl_text_ypos = 8
define gui.nvl_text_width = 650
define gui.nvl_text_xalign = 0.0

## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 940
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 950
define gui.nvl_thought_xalign = 0.0

## The position of nvl menu_buttons.
define gui.nvl_button_xpos = 450
define gui.nvl_button_xalign = 0.0

Re: [Tutorial] Customizing the NVL Textbox

Posted: Tue Apr 28, 2020 12:32 am
by noeinan
Got an answer to this in another thread, so I'm posting here in case anyone else runs into this problem!
MaydohMaydoh wrote: Mon Apr 27, 2020 12:31 pm

Code: Select all

gui.nvl_borders = Borders(0, 10, 0, 20)
is what's used to change the nvl window padding. Changing the second value in Borders with adjust the height at which the dialogue will start appearing.
Else you can use style.nvl_window.top_padding