Skip to content

Paragraph

Body text. Identical to Title and Heading apart from its default font.

{
  "Type": "Paragraph",
  "Text": "Pitch your tent on level ground, away from the river.",
  "MarginLeft": 16
}

Text wraps to the available width automatically. A word too long to fit on a line by itself is broken across lines rather than left hanging off the edge, so item IDs and long compound words are safe.

Use \n for a deliberate line break, and \n\n for a blank line between paragraphs.

Text fields

FontType defaults to Small, the game's small font.

Property Type Default Description
Text optional string The text to draw. Wraps automatically to the available width, including breaking words that are too long for a line on their own. \n forces a line break.
FontType optional font type varies Which font to draw with. The default differs per element type.
TextColor optional color the book's default The text colour.

Common fields

Scale on a Paragraph is the font scale, since a paragraph has no sprite. MarginLeft indents it, and because the margin narrows the width the text measures against, an indented paragraph wraps at the indented width rather than running off the page.

Property Type Default Description
Type required element type Which kind of element this is. Determines every other field below.
Id optional string An optional identifier for this element. Not used for navigation, purely for your own reference.
Alignment optional Left | Center | Right Left Where the element sits within its container's width. Only has an effect when the element is narrower than the space available (see Layout).
Scale optional number 1 The element's scale. Its meaning depends on the element type: sprite scale for Image, Panel, Banner, Button and Divider. Font scale for Title, Heading and Paragraph. See Units and scale.
SpacingAfter optional int 8 The gap between this element and the next one, in unscaled sprite pixels × Scale. Not applied after the last visible element, so a trailing gap can't appear at the bottom of a page or panel.
MarginLeft optional int 0 Space reserved to the element's left, in unscaled sprite pixels × Scale. This narrows the width the element measures against, so text wraps at the indented width rather than overflowing.
MarginRight optional int 0 Space reserved to the element's right, in unscaled sprite pixels × Scale.
Position optional Point { X: 0, Y: 0 } The element's position, in screen pixels. Only used in Background, Foreground, Underlay and Overlay, where elements are placed rather than stacked. Unlike every other spacing field this is not multiplied by Scale. Changing an element's scale resizes it in place rather than moving it.
Condition optional string A game state query. When it evaluates false the element is hidden, and elements below it close the gap. Re-checked several times a second while the book is open.
Action optional string A trigger action run when the element is clicked. When set, the element becomes interactive: any element type can have one, not just Button.
Actions optional list of string Trigger actions run in order when the element is clicked. Combined with Action rather than replacing it, so an element with both runs Action first.
Sound optional string bigSelect The cue played when the element is clicked. Only used when Action or Actions is set, and played once however many actions run. Set to null for a silent click.
HoverAction optional string A trigger action run when the cursor moves onto the element. Runs on entry, not while the cursor rests there. Sound doesn't apply.
HoverActions optional list of string Trigger actions run in order when the cursor moves onto the element. Combined with HoverAction rather than replacing it, so an element with both runs HoverAction first.
DisplayName optional string The bold title of the element's hover tooltip. Works in every list, including a page's Background and Foreground.
Description optional string The body of the element's hover tooltip. Works in every list, including a page's Background and Foreground, where setting it is also what makes an otherwise decorative element reachable by the cursor.

Long text can overflow the page

Nothing stops a paragraph from stacking past the bottom of a page. Parchment logs a warning, but you're responsible for fitting content to pages. Bear translations in mind: text that fits exactly in English may not in a longer language.