Data type: string with tags

Data type: string with tags

Syntax

Strings in text values can contain markup tags. These tags affect the presentation and sometimes the behaviour of the text.

A tag is something like "<tag>some text</tag>", similar to HTML. Tags are closed by the same tag with a / before it.

To represent the character "<" in a tagged string use "\<" in script code. This is written as the character with code 1 in files.

Basic markup

Tag Description
<b> The text inside the tag is bold.
<i> The text inside the tag is italic.
<sym> The text inside the tag is rendered as symbols, if a symbol font is set for the text box.
<color:???> The text inside the tag is rendered with the given color.
<size:???> The text inside the tag is rendered with the given font size in points, for example "<size:12>text</size>" makes the text 12 points. The text is scaled down proportionally when it does not fit in a text box and the scale down to attribute allows it.
<line> Line breaks inside this tag use the line height line, and they show a horizontal line.
<soft-line> Line breaks inside this tag use the soft line height.
<atom> An atomic piece of text. The cursor can never be inside it; it is selected as a whole. The program automatically inserts <atom-soft>.
<code> The text inside the tag is rendered in a monospace font. This is used for syntax highlighting script code.
<code-kw> The text inside the tag is highlighted as a keyword in source code.
<code-str> The text inside the tag is highlighted as a string in source code.

Other tags

Tag Description
<kw-?> Indicates that the text inside it is a keyword. This tag is automatically inserted by The expand_keywords function.
There are four versions, indicating whether or not reminder text is shown:
  • <kw-0>, Reminder text hidden, by default
  • <kw-1>, Reminder text shown, by default
  • <kw-a>, Reminder hidden manually
  • <kw-A>, Reminder shown manually
<sep> A separator between fields. This tag is automatically inserted by the combined_editor function.
Inserting this tag manually will confuse that function!
This tag can never be selected, and its contents can not be edited.
<prefix> At the beginning of a string, indicates a part that can not be selected. This tag is automatically inserted by the combined_editor function.
<suffix> At the end of a string, indicates a part that can not be selected. This tag is automatically inserted by the combined_editor function.
<sep-soft> Like <sep>, only hidden. This is inserted by combined_editor
<soft> Text who's width is ignored for alignment, similar to <sep-soft>, but not a separator.
<word-list-???> Indicate that the text inside the tag should be selected from a word list. The ??? must be the name of a word list in the game.
<error> The text inside the tag is an error, and is shown with a red wavy underline.
<error-spelling:???> A spelling error, marked by the check_spelling function. The ??? part indicates the language used for spelling checking.
any other tag Other tags are ignored.

Related functions

The following script functions deal with tags:

tag_contents Change the contents of a specific tag.
remove_tag Remove a tag, keep the contents.
remove_tags Remove all tags from tagged text.
to_text Remove all tags from tagged text, and convert it to a string.