Module yarnspinner::prelude
source · Expand description
Everything you need to get started using Yarn Spinner.
Macros§
- Create a
Library
from a list of named functions.
Structs§
- The result of a compilation.
- A collection of
Diagnostic
objects that describe problems that occurred during compilation. At least one of these diagnostics will have a severity ofDiagnosticSeverity::Error
. - Co-ordinates the execution of Yarn programs.
- An option to be presented to the user.
- IETF BCP 47 code. The default is “en-US”.
- The unique ID of a line in a Yarn script. In a Yarn script, line IDs look like this:
- Contains positional information about an instruction.
- Represents a range of text in a marked-up string.
- The identifying number for an option. You should not need to create these yourself, since you get them from
DialogueOption
s. - Information about a string. Stored inside a string table, which is produced from the Compiler.
- A structure that holds several
CompiledProgramAnalyser
s which are used to analyse one or more compiled Yarn programs withDialogue::analyse
. To get the analysis results, callContext::finish_analysis
afterwards. - A custom command found in a Yarn file within the
<<
and>>
characters. - An object that contains Yarn source code to compile, and instructions on how to compile it.
- Represents the contents of a file to compile.
- A collection of functions that can be called from Yarn scripts.
- A line of dialogue, sent from the
Dialogue
to the game.
Enums§
- The types of compilation that the compiler will do.
- An event encountered while running
Dialogue::continue_
. A caller is expected to handle these events and act accordingly. - A value associated with a markup name.
- Represents a Yarn value. The chosen variant corresponds to the last assignment of the value, with the type being inferred from the type checker.
Traits§
- The return value of a [
YarnFn
]. See [YarnFn
] for more information on the kinds of signatures that can be registered. - A trait for providing text to a
Dialogue
. The default implementation isStringTableTextProvider
, which keeps the text for the base language, i.e. the language the Yarn files are written in, and the text for the currently selected translation in memory. - Provides a mechanism for storing and retrieving instances of the
YarnValue
type. - A trait for analysing a compiled Yarn program. Can be used by adding them to a
Context
withContext::add_analyser
and then applied to a compiled Yarn program withDialogue::analyse
. - A function that can be registered into and called from Yarn. It must have the following properties: