Pardon our dust while we move our docs here. The Godot (GDScript) docs are on this site, and the Yarn language, Unity, Godot (C#) and Unreal docs are still at docs.yarnspinner.dev.

The Line Presenter (YarnLinePresenter) shows your dialogue one line at a time. It puts the speaker’s name in one label and the line’s text in another, types the text out, and waits for the player to continue before handing control back to the Dialogue Runner.

If you followed Adding Presenters, you already have one.

The labels it uses

A Line Presenter needs somewhere to put the text. In the scene from the previous page, that’s three labels inside a panel:

YarnLinePresenter
PanelContainer
VBoxContainer
CharacterLabelLabel
TextLabelRichTextLabel
ContinueIndicatorLabel
A Line Presenter with its panel and labels.

When the scene starts, the Line Presenter looks through the nodes under it and uses:

  • the first RichTextLabel it finds for the line’s text,
  • a Label with “character” in its name for the speaker’s name,
  • a node with “continue” or “indicator” in its name for the continue prompt.
The Line Presenter's panel in Godot's 2D view, with TextLabel selected: the area under the character name that holds the line's text TextLabel
The Line Presenter's panel in Godot's 2D view, with CharacterLabel selected: the strip across the top of the panel that shows the speaker's name CharacterLabel
The Line Presenter's panel in Godot's 2D view, with ContinueIndicator selected: the strip along the bottom of the panel, with Continue on the right ContinueIndicator
The three labels in the Line Presenter's panel, each selected in turn.

To use labels with other names, or labels that aren’t under the Line Presenter, assign them in its Text Label, Character Label and Continue Indicator properties, in the Inspector or from code. Anything you assign takes priority over what the Line Presenter finds.

@onready var line_presenter: YarnLinePresenter = $CanvasLayer/YarnLinePresenter

func _ready():
	line_presenter.text_label = $CanvasLayer/DialogueBox/Body
	line_presenter.character_label = $CanvasLayer/DialogueBox/NamePlate/Name
	line_presenter.character_container = $CanvasLayer/DialogueBox/NamePlate
	line_presenter.continue_indicator = $CanvasLayer/DialogueBox/NextArrow
Line 1 The Line Presenter.
Lines 3–4 Use your own RichTextLabel for the line’s text.
Lines 5–6 The label for the speaker’s name, and the container that’s hidden when a line has no speaker. Set both: the Line Presenter only fills in the container by itself when the scene starts.
Line 7 The node that’s shown while a line is on screen.
Assigning the labels from code.

When you set the character label from code, set Character Container too. The Line Presenter only fills that in when the scene starts.

The text label has to be a RichTextLabel. If the Line Presenter can only find a plain Label, it skips every line and logs an error.

The Line Presenter shows and hides the nodes under it, so there’s no need to hide the panel when the scene starts.

Character names

Most lines in Yarn start with the speaker’s name, like Rosa: Are you here about the lamp?.

When the Line Presenter has a character label, it puts Rosa in the character label and Are you here about the lamp? in the text label. If a line has no speaker, the character label is hidden. To hide something bigger than the label itself, such as a name plate with a background, set Character Container to that node, and the whole node is hidden.

If there’s no character label at all, Show Character Name in Line decides whether the name stays at the start of the text. It’s on by default, so the player sees Rosa: Are you here about the lamp?.

How text appears

By default, the text types out one letter at a time. Typewriter Mode changes that:

ModeWhat it does
InstantShows the whole line at once.
LetterTypes the line out one character at a time, at Characters per Second (60 by default).
WordTypes the line out one word at a time, at Words per Second (10 by default).
CustomUses your own typewriter, set in Custom Typewriter. See Typewriter and Effects.
The four typewriter modes.

With Use Markup on, which is the default, markup in your lines, such as [b]bold[/b], is shown as formatting. Turn it off to show every line as plain text. See Markup.

Justify Text stretches each line of text to fill the full width of the label. It’s off by default.

Use Fade Effect fades the panel in when a line starts and out when it ends. It’s on by default. Fade Up Duration and Fade Down Duration set how long each fade takes, in seconds.

Continuing to the next line

The continue prompt is shown while a line is on screen. When the player presses the Continue Action, ui_accept by default, which is Enter, Space or a gamepad’s bottom face button:

  • If the line is still typing out, it finishes immediately.
  • If the line is already complete, the Line Presenter moves on to the next one.

With Click Anywhere to Continue on, which is the default, a left click anywhere does the same. Clicking a link inside the line’s text doesn’t count. Turn this off if your game has other buttons the player can click during dialogue.

While options are showing, the Line Presenter ignores both, so the player’s clicks and key presses go to the option buttons.

To move on without the player pressing anything, turn on Auto Advance. Once a line has finished typing out, the Line Presenter waits Auto Advance Delay seconds, 1 by default, and then moves on.

Using a Line Advancer for input

If you want different controls, such as separate buttons for finishing a line and skipping it, or a button that ends the whole conversation, add a Line Advancer (YarnLineAdvancer) to your scene. It finds the Dialogue Runner by itself when they’re close together in the scene tree, or you can set its Dialogue Runner property.

Once a Line Advancer is in the scene, the Line Presenter stops handling input and leaves it to the Line Advancer. Its main settings:

SettingDefaultWhat it does
Input ModeInput ActionWhether it responds to Godot input actions, specific keys, or neither (so you call it from your own code).
Hurry Actionui_acceptFinishes the current line immediately.
Advance Actionui_cancelMoves on to the next line.
Combine Hurry and AdvanceOnPressing Hurry Action a second time, once the line is complete, moves on.
Cancel Dialogue ActionnoneEnds the whole conversation.
The Line Advancer’s main settings.

In Key Code mode, it uses Hurry Key, Advance Key and the other key settings in place of input actions.

Signals

SignalWhen it’s emitted
line_started(line)A line has started to appear.
line_finished(line)A line has finished typing out.
line_dismissed(line)A line has left the screen, after any fade.
continue_requestedThe player pressed Continue Action or clicked to continue.
The Line Presenter’s signals.

Settings

The Inspector for a YarnLinePresenter, showing Text Label, Character Label, Character Container, Show Character Name in Line, Continue Indicator, Typewriter Mode, Custom Typewriter, Justify Text, Characters per Second, Words per Second, Auto Advance, Auto Advance Delay, Use Fade Effect, Fade Up Duration, Fade Down Duration, Continue Action, Click Anywhere to Continue, Use Markup and Event Handlers
A Line Presenter in the Inspector, with its default settings. The three labels are empty because the Line Presenter finds them itself when the scene starts.
SettingDefaultWhat it does
Text Labelfound for youThe RichTextLabel that shows the line’s text.
Character Labelfound for youThe Label that shows the speaker’s name.
Character Containerthe character labelHidden when a line has no speaker.
Show Character Name in LineOnOnly used when there’s no character label: keeps the speaker’s name at the start of the text.
Continue Indicatorfound for youShown while a line is on screen.
Typewriter ModeLetterHow the text appears.
Custom TypewriternoneYour own typewriter, used in Custom mode.
Justify TextOffStretches the text to fill the label’s width.
Characters per Second60Typing speed in Letter mode. 0 shows the line at once.
Words per Second10Typing speed in Word mode.
Auto AdvanceOffMoves on by itself once a line has finished typing.
Auto Advance Delay1Seconds to wait before moving on.
Use Fade EffectOnFades the panel in and out around each line.
Fade Up Duration0.25Seconds to fade in.
Fade Down Duration0.1Seconds to fade out.
Continue Actionui_acceptThe input action that continues.
Click Anywhere to ContinueOnLets a left click continue.
Use MarkupOnShows markup as formatting.
Event HandlersemptyNodes that run game code partway through a line. See Markup.
Every Line Presenter setting.
Next step Options Presenter Showing options as buttons, and what happens to options the player can't choose.