The "vngen_option_create_ext_transformed" Function

Syntax

vngen_option_create_ext_transformed(id, text, sprite, spr_hover, spr_select, xorig, yorig, x, y, z, tx, ty, scaling, font, color, hov_x, hov_y, hov_xscale, hov_yscale, hov_color, sel_x, sel_y, sel_xscale, sel_yscale, sel_color, sel_duration, trans_in, trans_out, duration, ease);
ArgumentTypeDescription
idreal/stringThe unique identifier to use for the new option
textstringThe option text to display over the background (or "" for none)
spritespriteThe sprite to display as a background
spr_hoversprite/macroThe sprite to display as a background when hovered (or keyword none for default)
spr_activesprite/macroThe sprite to display as a background when selected (or keyword none for default)
xorigreal/macroThe horizontal sprite offset, or origin point, relative to the top-left corner
yorigreal/macroThe vertical sprite offset, or origin point, relative to the top-left corner
xrealThe horizontal position to display the option
yrealThe vertical position to display the option
zrealThe drawing depth and list order of the option, relative to other options only
txreal/macroThe horizontal position to display text, relative to the option sprite top-left corner (or keyword auto for center)
tyreal/macroThe vertical position to display text, relative to the option sprite top-left corner (or keyword auto for center)
scalinginteger/macroSets the automatic scaling mode for the option
fontfontThe font to draw text in, where fnt_default is default
colorcolorThe color to draw text in, where c_white is default
hov_xrealThe horizontal offset to shift the option when hovered
hov_yrealThe vertical offset to shift the option when hovered
hov_xscalerealThe horizontal scale multiplier to shift the option when hovered
hov_yscalerealThe vertical scale multiplier to shift the option when hovered
hov_colorcolorThe color to draw text in when hovered
sel_xrealThe horizontal offset to shift the option when selected
sel_yrealThe vertical offset to shift the option when selected
sel_xscalerealThe horizontal scale multiplier to shift the option when selected
sel_yscalerealThe vertical scale multiplier to shift the option when selected
sel_colorcolorThe color to draw text in when selected
sel_durationrealSets the duration of hover/select animations, in seconds
trans_inscriptSets the transition in animation to perform
trans_outscriptSets the transition out animation to perform
durationrealSets the duration of the transition animations, in seconds
easeinteger/macroSets the ease override for all button animations

Description

Creates a new option with extra features and hover and select transformations which will be displayed until any option in the current option block has been selected. The chosen option ID will be recorded as the selected choice. Options can selected by mouse/touch, or by other input devices with vngen_option_nav and vngen_option_select.

Unlike other entities, option z-index determines not just drawing depth, but also navigation order. Options with lower z-index will be considered lower in the list of options. If z-index is equal between two or more options, navigation order will automatically be set by reverse creation order, but this may or may not be visually correct. Therefore, it is recommended to always set z-index explicitly. The actual values used are inconsequential so long as they are ordered from highest to lowest.

Note that although this script is an action, it cannot be executed outside of a vngen_option block. In this way, an entire option block can be thought of as a single action.

See Included Animations and Macros & Keywords for a list of available transition animations and ease modes.

Example

if vngen_event() {
if vngen_option("op_choice", 0, 0, 0.5, 0.5) {
vngen_option_create_ext_transformed("op1", "Option 1", spr_option, spr_option_hover, spr_option_select, orig_center, orig_center, 0, 0, -1, scale_none, fnt_Arial, c_white, 32, 0, 1.25, 1.25, c_black, 0, 0, 1, c_yellow, 0.1, trans_slide_right, trans_slide_left, 1, ease_sin_out);
vngen_option_create_ext_transformed("op2", "Option 2", spr_option, spr_option_hover, spr_option_select, orig_center, orig_center, 0, 50, -2, scale_none, fnt_Arial, c_white, 32, 0, 1.25, 1.25, c_black, 0, 0, 1, c_yellow, 0.1, trans_slide_right, trans_slide_left, 1.5, ease_sin_out);
}
}