Skip to main content

The "vngen_scene_create_ext" Function

Syntax#

vngen_scene_create_ext(id, sprite, xorig, yorig, x, y, z, scaling, repeat, foreground, transition, duration, ease);
ArgumentTypeDescription
idreal/stringThe unique identifier to use for the new scene
spritespriteThe sprite to draw as a scene
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 scene, relative to the global offset
yrealThe vertical position to display the scene, relative to the global offset
zrealThe drawing depth of the scene, relative to other scenes only
scalinginteger/macroSets the automatic scaling mode for the scene
repeatbooleanEnables or disables endlessly tiling the scene
foregroundbooleanEnables or disables drawing the scene as a foreground
transitionscriptSets the transition animation to perform
durationrealSets the duration of the transition animation, in seconds
easeinteger/macroSets the ease override for the transition script

Description#

Creates a new scene with extra options as either a background (if foreground is false) or foreground (if foreground is true) which will be displayed until vngen_scene_destroy is run. Multiple scenes can exist simultaneously, however no two scenes 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.

VNgen uses texture extrapolation to draw tiled scenes by default. This allows tiled scenes to behave exactly like non-tiled ones, with support for rotation, gradient color blending, and deformations. However, not all platforms correctly support drawing scenes this way. For these platforms, see vngen_set_renderlevel to enable drawing tiled scenes using the old method. Legacy tiled scenes will still appear tiled, but will lack the features described above.

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

Example#

vngen_event() {
vngen_scene_create_ext("bg", spr_bg, orig_center, orig_center, 960, 540, 0, scale_none, false, false, trans_fade, 2, ease_sin_in_out);
}