Skip to main content

The "vngen_text_replace" Function

Syntax#

vngen_text_replace(id, name, text, font, color, duration, [ease], [lang]);
ArgumentTypeDescription
idreal/stringThe ID of the text to replace
namestring/macroThe new speaker name to associate with the text (or keyword previous for no change)
textstringThe new text string to display
fontfont/macroThe font to draw text in, where fnt_default is default (or keyword previous for no change, or keyword inherit for saved style)
colorcolor/macroThe color to draw text in, where c_white is default (or keyword previous for no change, or keyword inherit for saved style)
durationrealSets the duration of the fade transition, in seconds
[ease]integer/macroOptional: Sets the ease mode to perform the transition in
[lang]real/stringOptional: Sets the language flag for the text

Description#

Replaces the input entity ID with a new string of text and fades the old text to the new one over the input duration.

As with other types of modifications, replacements made with this script are permanent and will persist until another replacement is performed. This script cannot be performed simultaneously with other replacement actions operating on the same entity ID.

Replaced text will be automatically added to the backlog.

See Macros & Keywords for a list of available style modes and ease modes. See Language Functions for details on multi-language support. See Inline Markup for available markup tags.

Example#

vngen_event() {
vngen_text_replace("text", previous, "Hello, world!", previous, inherit, 3);
vngen_text_replace("text", "Jane Doe", "Hello, world!", fnt_Arial, c_white, 3, "en-US");
}