The "vngen_text_create_ext" Function

Syntax

vngen_text_create_ext(id, name, text, xorig, yorig, x, y, z, scaling, linebreak, font, color, transition, duration, ease, [lang]);
ArgumentTypeDescription
idreal/stringThe unique identifier to use for the new text
namestringThe character name to associate with the text
textstringThe text string to display
xorigreal/macroThe horizontal texture offset, or origin point, relative to the top-left corner
yorigreal/macroThe vertical texture offset, or origin point, relative to the top-left corner
xreal/macroThe horizontal position to display the text, relative to the global offset (or keyword auto to place after previous text)
yreal/macroThe vertical position to display the text, relative to the global offset (or keyword auto to place after previous text)
zrealThe drawing depth of the text, relative to other text only
scalinginteger/macroSets the automatic scaling mode for the text
linebreakrealThe width in pixels before text is wrapped into a new line
fontfont/macroThe font to draw text in, where fnt_default is default (or keyword inherit for saved style)
colorcolor/macroThe color to draw text in, where c_white is default (or keyword inherit for saved style)
transitionscriptSets the transition animation to perform
durationrealSets the duration of the transition animation, in seconds
easeinteger/macroSets the ease override for the transition script
[lang]real/stringOptional: Sets the language flag for the text

Description

Creates a new string of text with extra options which will be displayed until vngen_text_destroy is run. Multiple text elements can exist simultaneously, however no two may share the same ID. VNgen entity IDs are arbitrary and most can be either numbers or strings, but bear in mind that -1 is reserved as 'null' and cannot be used as an ID.

By default, text will be printed onto the screen with a typewriter effect at the rate set by vngen_set_speed, progressing one character at a time until the entire string is displayed. Once the string is complete, the engine will wait for user input before continuing to the next event. Running vngen_continue before the effect is complete will skip it.

Newly-created text will be automatically added to the backlog.

Note that text elements are displayed as a surface, or texture, and the exact dimensions of this texture may not be known. As a result, functions like xorig, yorig, and scaling may not behave as expected. It is important to test your text actions and design your fonts and linebreaks to a standard which results in predictable texture dimensions.

See Included Animations and Macros & Keywords for a list of available style modes, origin points, scaling modes, transition animations, and ease modes. See Language Functions for details on multi-language support. See Inline Markup for available markup tags.

Example

vngen_event() {
vngen_text_create("text", "John Doe", "Hello, world!", orig_left, orig_top, 200, 900, -1, scale_none, 1500, inherit, inherit, trans_fade, 2, ease_sin_out);
vngen_text_create("text", "", "John Doe||Hello, world!", orig_left, orig_top, 200, 900, -1, scale_none, 1500, fnt_Arial, c_white, trans_fade, 2, ease_sin_out, "en-US");
}