text
Module(s): vncanvas-base, vncanvas-script, canvastext
Description: Displays dialog or narration text in script box.
text, "text_to_display" |
Displays text in script
box. Uses previous settings. Pauses game by waiting for user input.
This is actually a shortcut for text, {value:"text_to_display"} |
text, {param} |
Displays text in script
box using specified parameters. Also pauses game by waiting for user input or
timer expiration. Parameters are given as {param:value, param:value, ...} |
| Parameter | Attributes and Description |
|---|---|
|
value:"text_to_display"
|
Sets the text to be displayed.
If "value" is a user variable id, the contents of the user variable will be displayed. To display user variables within the text, enclose it with '#', e.g. #var_name#. |
|
speaker:"speaker_name"
|
Optional
Displays a name tag at first line of script box.
The default name tag font is set in configuration file. |
|
font:"CSS_style_font_declaration"
|
Optional, Persistent
Sets the font to use when displaying text.
Declare as "weight size font-family color" in the given order. The default box font is set in configuration file. |
|
align:"left", "center", "right"
|
Optional, Persistent
Sets the text alignment for the script box. Default
is "left".
|
|
offset:[x, y]
|
Optional, Persistent
Text offset from top-left of script box. Default
is [10, 20] as used in "dim" box.
|
|
append:boolean (true/false)
|
Optional, Persistent
When true, text is appended on same window.
Default is false.
|
|
duration:number
|
Optional
Number of seconds to pause. Default is zero
or wait for user input.
|
|
effects:"effects_name"
|
Optional
Effects to display on script box.
Supported effects - "none" (default) - "fade" (fades the text in) - "scroll" (scrolls the text for credits) - "autotype" (overrides setting in config file) - "noautotype" (overrides setting in config file) |
|
voice:"path_to_sound_file_no_extension"
|
Optional
Voice dub if any. Only if 'value' is not empty
|
Text is displayed as given below.
chapter = [
...
/* Display text using font settings given */
text, {value:"This is first sample text.", font:"bold 16px 'Courier New' white"},
/* Text is appended without closing script box */
text, {value:"This is next text on same window.", append:true},
/* Text is appended again, waits for 5 seconds and appends next line */
text, {value:"This is next text on same window.", duration:5},
/* Note, this text call just uses a simple string to add the text */
text, "This is next text after timer expiration.",
/* Text is displayed on new window */
text, {value:"This is next text on new window.", append:false},
/* Text with name tag is displayed on new window */
text, {value:"This is ME speaking.", speaker:"ME"},
/* Some formatting:
\n - displays a new line in text
\ at end of line to continue long text at next line
*/
text, "Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi \
ut aliquip ex ea commodo consequat.\n Duis aute irure dolor in reprehenderit \
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n Excepteur \
sint occaecat cupidatat non proident, sunt in culpa qui officia \
deserunt mollit anim id est laborum.",
...
];