DialogueLine class
The DialogueLine class represents a single line of text within the
dialogue [Line].
The DialogueLine objects will be delivered to your DialogueView with
methods onLineStart(), onLineSignal(), onLineStop(), and
onLineFinish().
A dialogue line may contain a character (the name of the entity who is speaking), and tags -- a list of hashtag tokens that specify some meta information about the line.
Example of a dialogue line in yarn script:
Hermione: Holy cricket! You're Harry Potter. #surprised
Here the character is "Hermione", the text of the line is "Holy cricket! You're Harry Potter.", and the tags list will contain a single entry "#surprised".
A dialogue line may also contain inline expressions, which will be re-evaluated every time the line is executed by the dialogue runner:
Jenny: My favorite color is {$favoriteColor}, what about you?
After evaluation, the resulting string may be "My favorite color is vantablack, what about you?".
Lastly, a dialogue line may have markup attributes. These are similar to HTML tags, only they use square brackets:
Jenny: My [i]favorite[/i] color is [bb color=$color]{$color}[/bb].
These markup attributes will not be visible in the output (i.e. the
resulting text is still "My favorite color is vantablack"), but they can be
queried in the attributes list, which will specify that there is an
attribute [i] around the word "favorite", and another attribute [bb]
with parameter color around the word "vantablack".
Inline expressions cannot contain markup attributes.
- Implementers
Constructors
-
DialogueLine({required LineContent content, Character? character, List<
String> ? tags})
Properties
-
attributes
→ List<
MarkupAttribute> -
The list of markup spans associated with the line.
no setter
- character → Character?
-
The character who is speaking the line. This can be null if the line does
not contain a speaker.
no setter
- content → LineContent?
-
The content of this Line.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConst → bool
-
True if the line will never change upon subsequent reruns. That is, when
the line does not depend on any dynamic expressions.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
The list of hashtags associated with the line. If there are no hashtags,
the list will be empty.
no setter
- text → String
-
The computed text of the line, after substituting all inline expressions,
stripping the markup, and processing the escape sequences.
no setter
Methods
-
evaluate(
) → void - Computes the text of the line, substituting the current values of all inline expressions.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
processInDialogueRunner(
DialogueRunner dialogueRunner) → Future< void> - Runs the entry within the context of a dialogue runner.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override