Skip to main content

The "vngen_label_create_ext" Function

Syntax#

vngen_label_create_ext(id, label, xorig, yorig, x, y, z, scaling, linebreak, font, color, transition, duration, ease, [lang]);
ArgumentTypeDescription
idreal/stringThe unique identifier to use for the new label
labelstring/macroThe text string to display as a label (or keyword auto for speaker names)
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
xrealThe horizontal position to display the label, relative to the global offset
yrealThe vertical position to display the label, relative to the global offset
zrealThe drawing depth of the label, relative to other labels only
scalinginteger/macroSets the automatic scaling mode for the label
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 label

Description#

Creates a new static string of text with extra options which will be displayed until vngen_label_destroy is run. Multiple labels can exist simultaneously, however no two labels 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.

While labels share many properties with standard text elements, labels are static and do not affect progression, character speaking animations, or the backlog, and do not support advanced features such as a typewriter effect or markup.

While the actual label text can be anything, it is also possible to set labels to automatically display the name of the current speaker(s) defined by other text elements. This value is updated automatically at the start of every event, meaning the label does not require replacing to reflect each new speaker.

Note that labels 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 label 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 origin points, scaling modes, transition animations, and ease modes. See Language Functions for details on multi-language support.

Example#

vngen_event() {
vngen_label_create_ext("label", auto, orig_left, orig_top, 100, 750, -1, scale_none, 384, fnt_Arial, c_white, trans_wipe_right, 2, ease_sin_out);
vngen_label_create_ext("label", "John Doe", orig_left, orig_top, 100, 750, -1, scale_none, 384, fnt_Arial, c_white, trans_wipe_right, 2, ease_sin_out, "en-US");
}