Skip to main content

The "vngen_char_create_ext" Function

Syntax#

vngen_char_create_ext(name, spr_body, spr_face_idle, spr_face_talk, xorig, yorig, x, y, z, face_x, face_y, scaling, flip, idle, transition, duration, ease);
ArgumentTypeDescription
namestringThe unique identifier to use for the new character
spr_bodyspriteThe sprite to draw as a character body
spr_face_idlespriteThe sprite to draw as an idle face (or keyword none for none)
spr_face_talkspriteThe sprite to draw as a talking face (or keyword none for none)
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 character, relative to the global offset
yrealThe vertical position to display the character, relative to the global offset
zrealThe drawing depth of the character, relative to other characters only
face_xrealThe horizontal position to display the face, relative to the body sprite top-left corner
face_yrealThe vertical position to display the face, relative to the body sprite top-left corner
scalinginteger/macroSets the automatic scaling mode for the character
flipbooleanEnables or disables horizontally flipping the character
idlerealSets the delay in seconds between loops of the idle face sprite animation, where 3 is default
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 character with extra options which will be displayed until vngen_char_destroy is run. Multiple characters can exist simultaneously, however no two characters may share the same ID. Also note that unlike other entities, character IDs must be strings, not real numbers.

Note that using separate face sprites is optional. If only a body sprite is desired, spr_face_idle and spr_face_talk can be set to -1 or the keyword none to disable them.

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

Example#

vngen_event() {
vngen_char_create_ext("John Doe", spr_body, spr_face, spr_talking, orig_left, orig_bottom, 0, view_hview[0], -1, 384, 128, scale_none, false, trans_slide_right, 2, ease_quad_out);
}