Inserts
All of the below cause text or other types of content to appear in your passage. See Modifiers and Inserts for more information.
-
{ambient sound: 'sound name', volume: 0.5}
-
Begins playing a previously-defined ambient sound.
volume
can be omitted; by default, the ambient sound is played at full volume. -
{back link, label: 'Back'}
-
Renders a link to the previous passage.
label
can be omitted; Chapbook will default to using 'Back'. -
{cycling link for 'variableName', choices: ['one', 'two', 'three']}
-
Renders a cycling link that runs through the options listed in
choices
, saving the option the player selected to the variable named.for 'variable name'
can be omitted; Chapbook will not save the selected value anywhere. -
{dropdown menu for 'variableName', choices: ['one', 'two', 'three']}
-
Renders a dropdown menu that runs through the options listed in
choices
, saving the option the player selected to the variable named.for 'variable name'
can be omitted; Chapbook will not save the selected value anywhere. -
{embed Flickr image: 'embed code', alt: 'alternate text'}
abbreviated:{embed Flickr: 'embed code', alt: 'alternate text'}
-
Renders an image hosted on Flickr with alt text specified by
alt
. -
{embed image: 'url', alt: 'alternate text'}
-
Renders an image at a particular URL with alt text specified by
alt
. -
{embed passage named: 'passage name'}
abbreviated:{embed passage: 'passage name'}
- Renders the passage named in the insert. This executes any vars section in that passage.
-
{embed Unsplash image: 'URL', alt: 'alternate text'}
abbreviated:{embed Unsplash: 'URL', alt: 'alternate text'}
-
Renders an image hosted on Unsplash with alt text specified by
alt
. -
{embed YouTube video: 'URL'}
abbreviated:{embed YouTube: 'URL'}
- Renders a video player for a video hosted on YouTube.
-
{link to: 'passage name or URL', label: 'label'}
-
Renders a link to a passage name or address.
label
may be omitted; Chapbook will use the passage name or URL as label instead. -
{restart link, label: 'label'}
-
Renders a link that restarts the story.
label
may be omitted; Chapbook will use 'Restart' in that instance. -
{reveal link: 'label', text: 'revealed text'}
-
Renders a link that expands to show the
text
property when clicked or tapped. -
{reveal link: 'label', passage: 'passage name'}
-
Renders a link that expands to show the contents of the passage that has the name specified by the
passage
property when clicked or tapped. -
{sound effect: 'sound name', volume: 0.5}
-
Begins playing a [previously-defined sound effect][sound].
volume
can be omitted; by default, the ambient sound is played at full volume. -
{text input for: 'variable name', required: false}
-
Renders a text field, saving the text entered to the variable named.
for 'variable name'
can be omitted; Chapbook will not save the selected value anywhere.required
can also be omitted; Chapbook will make the field required unless you specify otherwise. -
{theme switcher, darkLabel: 'label', lightLabel: 'label'}
-
Renders a link that switches between light and dark themes.
darkLabel
andlightLabel
set the label shown when the theme is currently dark or light.