[Tutorial] Customizing the NVL Textbox

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#31 Post by Ryue » Tue Nov 22, 2016 4:00 pm

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^^')
Last edited by Ryue on Tue Nov 22, 2016 4:18 pm, edited 1 time in total.

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1775
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#32 Post by OokamiKasumi » Tue Nov 22, 2016 4:09 pm

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?
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#33 Post by Ryue » Tue Nov 22, 2016 4:16 pm

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.

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1775
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#34 Post by OokamiKasumi » Tue Nov 22, 2016 4:19 pm

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."
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

Georgel
Newbie
Posts: 23
Joined: Tue Mar 22, 2016 8:03 am
Organization: Seventh Heart Sudios
Location: Romania, Bucharest
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#35 Post by Georgel » Tue Jan 03, 2017 9:05 pm

Is it possible to change the default behavior of window where the window hides during animations if nvl was used in the game?

IndieAuthor
Newbie
Posts: 1
Joined: Mon Apr 03, 2017 9:19 pm
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#36 Post by IndieAuthor » Tue Apr 04, 2017 4:27 pm

I know. I'm late ... but what about WIDTH .... I'd like to have my NVL box cover only about 50% of the screen

willanik
Regular
Posts: 26
Joined: Fri Mar 24, 2017 7:44 pm
Contact:

Re: [Tutorial] Customizing the NVL Textbox

#37 Post by willanik » Sun May 14, 2017 12:34 am

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

Post Reply

Who is online

Users browsing this forum: Tesspolar