Skip to main content

The "vngen_perspective_replace" Function

Syntax#

vngen_perspective_replace(x, y, xoffset, yoffset, zoom, rot, strength, duration, [ease]);
ArgumentTypeDescription
xrealThe horizontal perspective position, where 0 is center
yrealThe vertical perspective position, where 0 is center
xoffsetrealThe horizontal perspective offset, or 'angle', where 0 is center
yoffsetrealThe vertical perspective offset, or 'angle', where 0 is center
zoomrealThe perspective zoom multiplier, where 1 is neutral
rotrealThe perspective rotation, in degrees
strengthrealThe parallax strength multiplier, or 'FOV', where 1 is default and 0 is no parallax
durationrealSets the length of the fade transition, in seconds
[ease]integer/macroOptional: Sets the ease mode for the transition animation

Description#

Unlike other *_replace functions, vngen_perspective_replace behaves quite similarly to vngen_perspective_modify, but rather than transition the global perspective properties directly, this script fades from the previous perspective to a new one.

As with other types of modifications, perspective replacements are permanent and will persist until another replacement is performed.

See Macros & Keywords for a list of available ease modes.

Example#

vngen_event() {
vngen_perspective_replace(0, 0, -50, 0, 1, 0, 1, 0.5, true);
}

This will center the perspective camera while fading the 'angle' 50 pixels to the left, effectively shifting scene elements to the right using parallax.