Characters

Learn about characters, their properties and how to create them!

Overview

Characters are probably one of the most important parts of your novel, not only used for displaying them as sprites but also to display their dialogs.

Properties

Name

Type

Description

name

string

Optional. The name that will be shown when this character speaks.

color

string

Optional. A valid CSS color which will be used to color the character's name.

directory

string

Optional. Specifies the sub-directory where the sprites and expressions images for the character are stored in case they are not in the root assets/characters directory.

sprites

Object

Optional. An object with the identifiers and file names for each sprite available for the character.

default_expression

string

Optional. Side image to show every time the character speaks.

expressions

Object

Optional. An object with the identifiers and file names for each side expression available for the character.

nvl

boolean

Optional. Default is false.

Whether the character's dialogs should be shown in NVL mode.

type_animation

boolean

Optional. Default is true.

This property indicates whether the typewriter animation should be used when the character speaks or not.

Examples

Declaring characters is really simple, first, you need an identifier, this is what you'll use for the dialog and show character actions. We'll choose the identifier y, short for Yui in this tutorial.

monogatari.characters ({
'y': {
}
});

Each character has many properties, like the name that is shown to the player, and the color for it.

monogatari.characters ({
'y': {
name: 'Yui',
color: '#00bfff'
}
});

Since we are building visual novels, we also need images for our characters! You need the Directory inside the assets/characters directory where your files will be placed, and assign a simple identifier to each file.

monogatari.characters ({
'e': {
name: 'Evelyn',
color: '#00bfff',
directory: 'Evelyn', // Optional*
sprites :{ // Images Identifier for the 'Show' statement.
normal: 'normal.png',
mad: 'hmph!.png',
doubt: 'uhh.png',
disappointed: 'ngggg....png',
happy: 'hehehehe.png'
},
default_expression: 'face.png', // Optional, side image to show every time the character speaks.
expressions: { // Side images identifiers to show on dialogs
smiling: 'smiling.png'
}
}
});

The directory attribute is a sub directory of characters where the images will be pulled, if no directory is given, it will be assumed to be the characters directory itself.