Add character names to associate with image sources (as URLs). Must be done in StoryInit
or the Story JavaScript area. Character names become macros later.
Create a speech box with the given character name and image, which says the indicated text content.
Characters added via <<character>>
/ setup.addCharacter()
are added as macros, e.g. <<lisa>>...<</lisa>>
that can be used as shortcuts for the <<say>>
macro. These macros are case-sensitive: <<character 'Lisa' 'assets/portraits/lisa.png'>>
would yield the macro <<Lisa>>
, while <<character 'lisa' 'assets/portraits/lisa.png'>>
would yield the macro <<lisa>>
. The name is capitalized by default in the output, so lisa
or Lisa
becomes Lisa
.
Output elements are contained within a <div>
element with the class say
and a class based on the slugified character name. The portrait image is .say img
, the character name area is .say p:first-of-type
, and the text content area is .say p:last-of-type
.