Skip to main content

The "vngen_char_create" Function

Syntax#

vngen_char_create(name, spr_body, spr_face_idle, spr_face_talk, x, y, z, face_x, face_y, flip, 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)
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
flipbooleanEnables or disables horizontally flipping the character
transitionscriptSets the transition animation to perform
durationrealSets the duration of the transition animation, in seconds
[ease]integer/macroOptional: Sets the ease override for the transition script

Description#

Creates a new character 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 transition animations and ease modes.

Example#

vngen_event() {
vngen_char_create("John Doe", spr_body, spr_face, spr_talking, 0, view_hview[0] - 900, -1, 384, 128, false, trans_slide_right, 2);
}