Skip to content

Paragraph

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

{
  "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.

Paragraph fields

Property Type Default Description
Width optional int? the available width The width the paragraph occupies, in unscaled pixels × Scale. Text wraps at it and the paragraph reserves it. Clamped to the width available, so it can only narrow the paragraph and never widen it.

Give Width when you want a narrower column than the page provides, such as text set beside an image or a short line you want broken at a particular point.

{
  "Type": "Paragraph",
  "Text": "Pitch your tent on level ground, away from the river.",
  "Width": 120,
  "Alignment": "Center"
}

Width changes what Alignment aligns against

Without a Width a paragraph is only as wide as its longest line, so Alignment centres that block within the column. With a Width the paragraph is exactly that wide wherever the column allows it, so Alignment centres each line within the Width box and the box itself sits at the start of the column. Give the box an Alignment of its own by wrapping it in a Panel, or offset it with Position.

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. Can carry tokens, both Parchment's %Token% forms and the game's tokenizable strings.
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 color.
ShadowColor optional color the game's shadow color The color of the drop shadow drawn behind the text, alpha included. Left off, the shadow follows TextColor's alpha instead. Ignored when FontType is SpriteText, which draws its own outline.

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). In a placed list it anchors the element and Position is measured from there.
VerticalAlignment optional Top | Center | Bottom Top Where the element sits within its container's height. Only used in Background, Foreground, Underlay and Overlay, since a stacked element takes its vertical position from the elements above it (see Placed elements). Setting it on a stacked element logs an error and does nothing.
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. Measured from wherever Alignment and VerticalAlignment anchor the element, so under the default Left and Top it's a plain coordinate (see Placed elements). 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. Understands tokens.
Lifetime optional number Seconds the element stays up once shown. Setting it makes the element a timed one: hidden until a ShowElement action names it, so an Id is required.
FadeAfter optional number Seconds before it starts fading, reaching nothing at the end of Lifetime. Needs Lifetime, and must be below it.
IgnoreCursor optional bool false Lets the cursor pass straight through the element to whatever sits beneath it, so it can't be hovered or clicked. Its children and its own Background and Foreground are still reachable (see Passing the cursor through).
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. Understands tokens.
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. Understands tokens.
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. Understands tokens.
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. Understands tokens.
DisplayName optional string The bold title of the element's hover tooltip. Works in every list, including a page's Background and Foreground. Can carry tokens.
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. Ignored when IgnoreCursor is set, which logs a warning. Can carry tokens.
Tags optional list of string Free-form markers other mods can read off whatever the cursor is over, such as Lookup Anything support. Tagging an element also makes it reachable by the cursor, since a tag is only useful on something that can be hovered. Ignored when IgnoreCursor is set. See Tags.
ParseTokenizableStrings optional bool true Whether the game's [Token] tokenizable strings are resolved in this element's Text, DisplayName, Description, Condition and actions. Set it to false where a square bracket is meant as the character itself.

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.