Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

ReplacementMarkerResult

A bundle of results from processing replacement markers.
public struct ReplacementMarkerResult

Inherits from System.ValueType

See also

#Constructors

#ReplacementMarkerResult(int)

Convenience form of ReplacementMarkerResult(List<LineParser.MarkupDiagnostic>,int) for when there are no diagnostics.
public ReplacementMarkerResult(int invisibleCharacters)

Parameters

  • invisibleCharactersint
    the number of invisible characters generated during processing.

#ReplacementMarkerResult(List<LineParser.MarkupDiagnostic>, int)

Convenience constructor for replacement markup results.
public ReplacementMarkerResult(List<LineParser.MarkupDiagnostic> diagnostics, int invisibleCharacters)

Parameters

  • diagnosticsSystem.Collections.Generic.List<Yarn.Markup.LineParser.MarkupDiagnostic>
    The diagnostics generated during processing
  • invisibleCharactersint
    the number of invisible characters generated during processing.

#Fields

#Diagnostics

The collection of diagnostics produced during processing, if any.
public List<LineParser.MarkupDiagnostic> Diagnostics;

Type List

#InvisibleCharacters

The number of invisible characters added into the line during processing.
public int InvisibleCharacters;

Type Int32

This will vary depending on what the replacement markup needs to do.
  • When only inserting rich-text tags, this should be the length of all inserted text. For example "this is text with [bold]some bold[/bold] elements" translated into Unity style rich-text become "this is text with <b>some bold</b> elements". In this case then the value of InvisibleCharacters would be seven.

  • When only modifying the content of the children text, such as making all text upper case, this should be 0. For example "this is text with [upper]some uppercased[/upper] elements" is transformed into "this is text with SOME UPPERCASED elements". The number of invisible character will be zero.

  • When adding new content into the line (regardless of being added at the start, end, or middle) this should be zero but the replacement processor should make sure to shift along it's children attributes where appropriate. For example "this is text with [emph]some emphasised[/emph] elements" transformed into "this is text with !!some emphasised!! elements" the value of InvisibleCharacters would be zero. In this case however the childAttributes in ProcessReplacementMarker(MarkupAttribute,System.Text.StringBuilder,List<MarkupAttribute>,string) would need to be shifted down two.

Generated from Yarn Spinner for Unity 3.3.