Skip to main content

The "vngen_attach_create_ext" Function

Syntax#

vngen_attach_create_ext(name, id, sprite, xorig, yorig, x, y, z, scaling, transition, duration, ease);
ArgumentTypeDescription
namestringThe ID of the character to apply attachment to
idreal/stringThe unique identifier to use for the new attachment
spritespriteThe sprite to draw as an attachment
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 attachment, relative to the character top-left corner
yrealThe vertical position to display the attachment, relative to the character top-left corner
zrealThe drawing depth of the attachment, relative to other attachments only
scalinginteger/macroSets the automatic scaling mode for the attachment, relative to the parent character
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 attachment with extra options for the input character ID which will be displayed until vngen_attach_destroy is run. Multiple attachments can exist simultaneously, however no two attachments may share the same ID on the same character. 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. Unlike other entities, because attachments are specific to each character, attachments on other characters can use the same ID without conflict.

Note that all coordinates are relative to the parent character, including the z-index. For attachments, negative z-index will display the attachment in front of the parent character, while positive z-index will display the attachment behind them. The same applies to the scaling mode, which is relative to the parent character rather than to the entire display.

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

Example#

vngen_event() {
vngen_attach_create_ext("John Doe", "attach", spr_attach, orig_center, orig_center, 50, 150, -1, scale_none, trans_wipe_right, 0.5, ease_sin_out);
}