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).

MarkupAttribute

Represents a range of text in a marked-up string.
public struct MarkupAttribute

Inherits from System.ValueType

You do not create instances of this struct yourself. It is created by objects that can parse markup, such as LineParser.

See also

  • Yarn.Markup.LineParser.ParseString

#Properties

#Length

Gets the number of text elements in the plain text that this attribute covers.
public int Length { get; internal set; }

Type Int32

#Name

Gets the name of the attribute.
public string Name { get; internal set; }

Type String

#Position

Gets the position in the plain text where this attribute begins.
public int Position { get; internal set; }

Type Int32

#Properties

Gets the properties associated with this attribute.
public IReadOnlyDictionary<string, MarkupValue> Properties { get; internal set; }

Type IReadOnlyDictionary

#Methods

#Shift(int)

Creates a new MarkupAttribute based on the current instance whose Position is shifted towards the end of the string by shift characters.
public readonly MarkupAttribute Shift(int shift)

Parameters

  • shiftint
    The number of characters to shift by.

Returns MarkupAttribute: A new MarkupAttribute with an updated Position.

#ToString()

public override readonly string ToString()

Returns String

#TryGetProperty(string, bool)

Gets a boolean property named name from this attribute, if present.
public readonly bool TryGetProperty(string name, out bool result)

Parameters

  • namestring
    The name of the property.
  • resultbool
    On return, the property's value if found, or false if not.

Returns Boolean: true if a property named name was found; false otherwise.

#TryGetProperty(string, float)

Gets a float property named name from this attribute, if present.
public bool TryGetProperty(string name, out float result)

Parameters

  • namestring
    The name of the property.
  • resultfloat
    On return, the property's value if found, or zero if not.

Returns Boolean: true if a property named name was found; false otherwise.

#TryGetProperty(string, int)

Gets an integer property named name from this attribute, if present.
public readonly bool TryGetProperty(string name, out int result)

Parameters

  • namestring
    The name of the property.
  • resultint
    On return, the property's value if found, or zero if not.

Returns Boolean: true if a property named name was found; false otherwise.

#TryGetProperty(string, MarkupValue)

Gets a property named name from this attribute, if present.
public readonly bool TryGetProperty(string name, out MarkupValue result)

Parameters

  • namestring
    The name of the property.
  • On return, the property's value if found, or zero if not.

Returns Boolean: true if a property named name was found; false otherwise.

#TryGetProperty(string, string?)

Gets a string property named name from this attribute, if present.
public readonly bool TryGetProperty(string name, [NotNullWhen(true)] out string? result)

Parameters

  • namestring
    The name of the property.
  • resultstring
    On return, the property's value if found, or null if not.

Returns Boolean: true if a property named name was found; false otherwise.

Generated from Yarn Spinner for Unity 3.3.