Character

class Character

A Character represents a person who is speaking a particular line in a dialogue. This object is available as the .character property of a DialogueLine delivered to your DialogueView.

All characters must be declared with the help of the <<character>> command, unless YarnProject’s setting strictCharacterNames is set to false.

Constructors

Character(this.name, {List<String>? aliases})

Properties

name : String

The canonical name of the character, which was the first argument in the <<character>> command.

aliases : List<String>

Additional names (IDs) that may be used for this character in yarn scripts.

dataMap<String, dynamic>

Additional information associated with this character. This may include their short bio, portrait, affiliation, color, etc. This information must be stored for each character manually, and then it will be accessible from DialogueViews.

You can store any key-value pairs here that you want, or nothing at all.

See Also

  • CharacterStorage: the container where all Character objects within a YarnProject are cached.