Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Field in LineView
The canvas group that contains the UI elements used by this Line View.
If useFadeEffect is true, then the alpha value of this UnityEngine.CanvasGroup
will be animated during line presentation and dismissal.
LineView.useFadeEffect: Controls whether the line view should fade in when lines appear, and fade out when lines disappear.
Field in
Controls whether this Line View will wait for user input before indicating that it has finished presenting a line.
If this value is true, the Line View will not report that it has finished presenting its lines. Instead, it will wait until the method is called.
The will not proceed to the next piece of content (e.g. the next line, or the next options) until all Dialogue Views have reported that they have finished presenting their lines. If a doesn't report that it's finished until it receives input, the will end up pausing.
This is useful for games in which you want the player to be able to read lines of dialogue at their own pace, and give them control over when to advance to the next line.
Field in
The game object that represents an on-screen button that the user can click to continue to the next piece of dialogue.
This game object will be made inactive when a line begins appearing, and active when the line has finished appearing.
This field will generally refer to an object that has a UnityEngine.UI.Button
component on it that, when clicked, calls . However, if your game requires specific UI needs, you can provide any object you need.
: Controls whether this Line View will wait for user input before indicating that it has finished presenting a line.
Class in Yarn.Unity
Inherits from DialogueViewBase
This class is obsolete and may be removed from a future version of Yarn Spinner.
A Dialogue View that presents lines of dialogue, using Unity UI elements.
Controls whether this Line View will wait for user input before indicating that it has finished presenting a line.
The canvas group that contains the UI elements used by this Line View.
The TMPro.TextMeshProUGUI
object that displays the character names found in dialogue lines.
The game object that represents an on-screen button that the user can click to continue to the next piece of dialogue.
The time that the fade effect will take to fade lines in.
The time that the fade effect will take to fade lines out.
The amount of time to wait after any line
The TMPro.TextMeshProUGUI
object that displays the text of dialogue lines.
A Unity Event that is called each time a character is revealed during a typewriter effect.
A Unity Event that is called when a pause inside of the typewriter effect finishes and the typewriter has started once again.
A Unity Event that is called when a pause inside of the typewriter effect occurs.
The number of characters per second that should appear during a typewriter effect.
Controls whether the line view should fade in when lines appear, and fade out when lines disappear.
Inserts TextMeshPro line break markup in a line where Yarn line break attributes appear.
Applies the palette
to the line based on it's markup.
The gameobject that holds the textfield.
Controls whether the object will show the character name present in the line or not.
Controls whether the text of should be gradually revealed over time.
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 is clicked.
Called by the to signal that a line should be displayed to the user.
Called by to signal that the user has requested that the dialogue advance.
Method in LineView
Inserts TextMeshPro line break markup in a line where Yarn line break attributes appear.
line
The line containing Yarn line break attributes.
A string containing TextMeshPro <br/>
markers where Yarn [br/]
attributes appear.
Field in
Controls whether the object will show the character name present in the line or not.
This value is only used if is null
.
If this value is true
, any character names present in a line will be shown in the object.
If this value is false
, character names will not be shown in the object.
Field in
Controls whether the text of should be gradually revealed over time.
If this value is true
, the object's TMPro.TMP_Text.maxVisibleCharacters
property will animate from 0 to the length of the text, at a rate of letters per second when the line appears. is called for every new character that is revealed.
If this value is false
, the will all be revealed at the same time.
If is true
, the typewriter effect will run after the fade-in is complete.
: The TMPro.TextMeshProUGUI
object that displays the text of dialogue lines.
: A Unity Event that is called each time a character is revealed during a typewriter effect.
: The number of characters per second that should appear during a typewriter effect.
Method in
Called by the to signal that the dialogue has ended, and no more lines will be delivered.
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 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.
Method in LineView
Called by the DialogueRunner to signal that the view should dismiss its current line from display, and clean up.
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 DismissLine(Action) 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.
Action
onDismissalComplete
The method that should be called when the view has finished dismissing the line.
Method in LineView
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.
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 InterruptLine(LocalizedLine,Action) is called, you must not call the completion handler that RunLine(LocalizedLine,Action) 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.
The current line that is being presented.
onDialogueLineFinished
The method that should be called after the line has finished being presented.
Action
onInterruptLineFinished
DialogueViewBase.RunLine(LocalizedLine,Action): Called by the DialogueRunner to signal that a line should be displayed to the user.
DialogueViewBase.DismissLine(Action): Called by the DialogueRunner to signal that the view should dismiss its current line from display, and clean up.
Field in
Controls whether the line view should fade in when lines appear, and fade out when lines disappear.
If this value is true
, the object's alpha property will animate from 0 to 1 over the course of seconds when lines appear, and animate from 1 to zero over the course of seconds when lines disappear.
If this value is false
, the object will appear instantaneously.
: The canvas group that contains the UI elements used by this Line View.
: The time that the fade effect will take to fade lines in.
: The time that the fade effect will take to fade lines out.
Method in
Called by to signal that the user has requested that the dialogue advance.
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.
Method in
Applies the palette
to the line based on it's markup.
This is static so that other dialogue views can reuse this code. While this is simplistic it is useful enough that multiple pieces might well want it.
A TMP formatted string with the palette markup values injected within.
dialogueLine
line
The parsed marked up line with it's attributes.
palette
The palette mapping attributes to colours.
bool
applyLineBreaks
If the [br /] marker is found in the line should this be replaced with a line break?
Method in LineView
Called by the DialogueRunner to signal that a line should be displayed to the user.
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 LineProviderBehaviour.
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 DismissLine(Action) 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 requestInterrupt to tell the Dialogue Runner to interrupt the line.
The onDialogueLineFinished
method should only be called when RunLine(LocalizedLine,Action) finishes its presentation normally. If InterruptLine(LocalizedLine,Action) has been called, you must call the completion handler that it receives, and not the completion handler that RunLine(LocalizedLine,Action) 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.
The content of the line that should be presented to the user.
Action
onDialogueLineFinished
The method that should be called after the line has finished being presented.
DialogueViewBase.InterruptLine(LocalizedLine,Action): 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.
DialogueViewBase.DismissLine(Action): Called by the DialogueRunner to signal that the view should dismiss its current line from display, and clean up.
DialogueViewBase.RunOptions(DialogueOption[],Action<int>): Called by the DialogueRunner to signal that a set of options should be displayed to the user.
dialogueLine