All pages
Powered by GitBook
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

OnContinueClicked()

Method in LineView

Summary

Called when the Yarn.Unity.LineView.continueButton is clicked.

public void OnContinueClicked()

DialogueComplete()

Method in

Summary

Called by the to signal that the dialogue has ended, and no more lines will be delivered.

LineView

Class in

Inherits from

Summary

A Dialogue View that presents lines of dialogue, using Unity UI elements.

Remarks

This method is called after the last piece of content (that is, lines, options or commands) finished running.

This method is a good place to perform tasks like dismissing on-screen dialogue UI (for example, turning off a letterboxing effect, or hiding dialogue UI elements.)

If Stop() is called, this method is how your custom views are informed of this. This allows you to skip over the normal flow of dialogue, so please use this method to clean up your views.

The default implementation of this method does nothing.

public override void DialogueComplete()
LineView
DialogueRunner
Methods
Name
Description

Called by the to signal that the dialogue has ended, and no more lines will be delivered.

Called by the to signal that the view should dismiss its current line from display, and clean up.

Called by the to signal that a line has been interrupted, and that the Dialogue View should finish presenting its line as quickly as possible.

Called when the Yarn.Unity.LineView.continueButton is clicked.

Called by the to signal that a line should be displayed to the user.

Yarn.Unity
DialogueViewBase

DismissLine(Action)

Method in LineView

Summary

Called by the DialogueRunner to signal that the view should dismiss its current line from display, and clean up.

Remarks

This method is called when all Dialogue Views attached to a Dialogue Runner report that they have finished presenting this line. When this occurs, the Dialogue Runner calls on all Dialogue Views to tell them to clear their current line from display.

Depending on how the Dialogue View presents lines, "dismissing" a line may mean different things. For example, a Dialogue View that presents on-screen text might fade the text away, or a Dialogue View that presents voice-over dialogue may not need to do anything at all (because audio finished playing when the line finished presenting.)

Dismissing the line can take time, but should ideally be as fast as possible, because the user will be waiting for the next piece of content to appear.

When the line has finished dismissing, this method calls onDismissalComplete to indicate that the dismissal is complete. When all Dialogue Views on a Dialogue Runner have finished dismissing, the Dialogue Runner moves on to the next piece of content.

The default implementation of this method immediately calls the onDismissalComplete method (that is, it reports that it has finished dismissing the line the moment that it receives it), and otherwise does nothing.

Parameters

Name
Description
public class LineView : DialogueViewBase
public override void DismissLine(Action onDismissalComplete)

System.Action onDismissalComplete

The method that should be called when the view has finished dismissing the line.

DismissLine(Action)

UserRequestedViewAdvancement()

Called by DialogueAdvanceInput to signal that the user has requested that the dialogue advance.

DialogueComplete()
DialogueRunner
DismissLine(Action)
DialogueRunner
InterruptLine(LocalizedLine,Action)
DialogueRunner
OnContinueClicked()
RunLine(LocalizedLine,Action)
DialogueRunner

RunLine(LocalizedLine,Action)

Method in LineView

Summary

Called by the DialogueRunner to signal that a line should be displayed to the user.

Remarks

When this method is called, the Dialogue View should present the line to the user. The content to present is contained within the dialogueLine parameter, which contains information about the line in the user's current locale.

The value of the dialogueLine parameter is produced by the Dialogue Runner's .

It's up to the Dialogue View to decide what "presenting" the line may mean; for example, showing on-screen text, or playing voice-over audio.

When the line has finished being presented, this method calls the onDialogueLineFinished method, which signals to the Dialogue Runner that this Dialogue View has finished presenting the line. When all Dialogue Views have finished presenting the line, the Dialogue Runner calls to signal that the views should get rid of the line.

If you want to create a Dialogue View that waits for user input before continuing, either wait for that input before calling onDialogueLineFinished, or don't call it at all and instead call to tell the Dialogue Runner to interrupt the line.

The onDialogueLineFinished method should only be called when finishes its presentation normally. If has been called, you must call the completion handler that it receives, and not the completion handler that has received.

The default implementation of this method immediately calls the onDialogueLineFinished method (that is, it reports that it has finished presenting the line the moment that it receives it), and otherwise does nothing.

Parameters

Name
Description

See Also

  • : Called by the to signal that a line has been interrupted, and that the Dialogue View should finish presenting its line as quickly as possible.

  • : Called by the to signal that the view should dismiss its current line from display, and clean up.

  • : Called by the to signal that a set of options should be displayed to the user.

UserRequestedViewAdvancement()

Method in LineView

Summary

Called by DialogueAdvanceInput to signal that the user has requested that the dialogue advance.

public override void UserRequestedViewAdvancement()

Remarks

When this method is called, the Dialogue View should advance the dialogue. Advancing the dialogue can mean different things, depending on the nature of the dialogue view, and its current state.

In many situations, if the Dialogue View hasn't yet finished presenting its line (that is, the method has been called, but it hasn't yet called its completion handler), it's sufficient to call the method, which tells the Dialogue Runner to interrupt the current line.

'Advancing' the dialogue may not always mean finishing the line's presentation.

For example, in the Legend of Zelda series of games, lines of dialogue are displayed one character at a time in a text box, until the line has finished appearing. At this point, the text box displays a button to continue; when the user presses the primary input button (typically the A button), the line is dismissed. However, if this button is pressed while the line is still appearing, the rest of the line appears all at once, and the button appears. Finally, if a secondary input button (typically the B button) is pressed at any point, the line is interrupted, and the dialogue proceeds to the next line immediately.

is designed to give your Dialogue View an opportunity to decide whether it wants to interrupt the entire line for all views, or simply speed up the delivery of this view.

The default implementation of this method does nothing.

InterruptLine(LocalizedLine,Action)

Method in LineView

Summary

Called by the DialogueRunner to signal that a line has been interrupted, and that the Dialogue View should finish presenting its line as quickly as possible.

Remarks

This method is called when Dialogue Runner wants to interrupt the presentation of the current line, in order to proceed to the next piece of content.

When this method is called, the Dialogue View must finish presenting their line as quickly as it can. Depending on how this Dialogue View presents lines, this can mean different things: for example, a view that plays voice-over audio might stop playback immediately, or fade out playback over a short period of time; a view that displays text a letter at a time might display all of the text at once.

The process of finishing the presentation can take time to complete, but should happen as quickly as possible, because this method is generally called when the user wants to skip the current line.

When the line has finished presenting, the onDialogueLineFinished method must be called, which indicates to the Dialogue Runner that this line is ready to be dismissed.

When is called, you must not call the completion handler that has previously received - this completion handler is no longer valid. Call this method's onDialogueLineFinished instead.

The default implementation of this method immediately calls the onDialogueLineFinished method (that is, it reports that it has finished presenting the line the moment that it receives it), and otherwise does nothing.

Parameters

Name
Description

See Also

  • : Called by the to signal that a line should be displayed to the user.

  • : Called by the to signal that the view should dismiss its current line from display, and clean up.

public override void RunLine(LocalizedLine dialogueLine, Action onDialogueLineFinished)
public override void InterruptLine(LocalizedLine dialogueLine, Action onInterruptLineFinished)

Yarn.Unity.LocalizedLine dialogueLine

The content of the line that should be presented to the user.

System.Action onDialogueLineFinished

The method that should be called after the line has finished being presented.

LineProviderBehaviour
DismissLine(Action)
requestInterrupt
RunLine(LocalizedLine,Action)
InterruptLine(LocalizedLine,Action)
RunLine(LocalizedLine,Action)
DialogueViewBase.InterruptLine(LocalizedLine,Action)
DialogueRunner
DialogueViewBase.DismissLine(Action)
DialogueRunner
DialogueViewBase.RunOptions(DialogueOption[],Action<int>)
DialogueRunner
RunLine(LocalizedLine,Action)
requestInterrupt
UserRequestedViewAdvancement()

Yarn.Unity.LocalizedLine dialogueLine

The current line that is being presented.

onDialogueLineFinished

The method that should be called after the line has finished being presented.

System.Action onInterruptLineFinished

InterruptLine(LocalizedLine,Action)
RunLine(LocalizedLine,Action)
DialogueViewBase.RunLine(LocalizedLine,Action)
DialogueRunner
DialogueViewBase.DismissLine(Action)
DialogueRunner