To call the narrator, I use this:
Code: Select all
define nn = Character(None, kind=nvl)
Code: Select all
nn "Test script"
nn "Test"
nn "Again, test"
This is the code that we use:
Code: Select all
screen nvl(dialogue, items=None):
window:
style "nvl_window"
has vbox:
spacing gui.nvl_spacing
## Displays dialogue in either a vpgrid or the vbox.
if gui.nvl_height:
vpgrid:
cols 1
yinitial 1.0
use nvl_dialogue(dialogue)
else:
use nvl_dialogue(dialogue)
for i in items:
textbutton i.caption:
action i.action
style "nvl_button"
add SideImage() xalign 0.0 yalign 1.0
screen nvl_dialogue(dialogue):
for d in dialogue:
window:
id d.window_id
fixed:
yfit gui.nvl_height is None
if d.who is not None:
text d.who:
id d.who_id
text d.what:
id d.what_id
define config.nvl_list_length = 6
style nvl_window is default
style nvl_entry is default
style nvl_label is say_label
style nvl_dialogue is say_dialogue
style nvl_button is button
style nvl_button_text is button_text
style nvl_window:
xfill True
yfill True
background "gui/nvl.png"
xpadding 100
ypadding 100
#padding gui.nvl_borders.padding
style nvl_entry:
xfill True
ysize gui.nvl_height
style nvl_label:
xpos gui.nvl_name_xpos
xanchor gui.nvl_name_xalign
ypos gui.nvl_name_ypos
yanchor 0.0
xsize gui.nvl_name_width
min_width gui.nvl_name_width
text_align gui.nvl_name_xalign
style nvl_dialogue:
xpos gui.nvl_text_xpos
xanchor gui.nvl_text_xalign
ypos gui.nvl_text_ypos
xsize gui.nvl_text_width
min_width gui.nvl_text_width
text_align gui.nvl_text_xalign
layout ("subtitle" if gui.nvl_text_xalign else "tex")
style nvl_thought:
xpos gui.nvl_thought_xpos
xanchor gui.nvl_thought_xalign
ypos gui.nvl_thought_ypos
xsize gui.nvl_thought_width
min_width gui.nvl_thought_width
text_align gui.nvl_thought_xalign
layout ("subtitle" if gui.nvl_text_xalign else "tex")
style nvl_button:
properties gui.button_properties("nvl_button")
xpos gui.nvl_button_xpos
xanchor gui.nvl_button_xalign
style nvl_button_text:
properties gui.button_text_properties("nvl_button")