Scripting API

Scripting API

FixedText32

Struct in Abyss.Core, from Abyss.Core.

Text of up to 32 bytes that a struct holds in itself — an item's name in a data asset, a label in a component — plain data, as a component and settings have to be: its UTF-8 and zeros after. The inspector shows it as a box to type in, and a scene and a data asset's file write it as text.

public struct FixedText32

Remarks

Made from a string, FixedText32 name = "Sword";, and read back with FixedText32.ToString. A string that takes more than 32 bytes is refused rather than cut: a letter outside ASCII takes two to four. FixedText32, FixedText64, FixedText128 and FixedText256 are the sizes there are.

Constructors

FixedText32

public FixedText32(string? text)

Holds text.

Parameters

  • text

Exceptions

Properties

Length

public readonly int Length { get; }

How many bytes the text takes.

IsEmpty

public readonly bool IsEmpty { get; }

Whether it holds nothing.

Methods

ToString

public override readonly string ToString()

The text it holds.

Equals

public readonly bool Equals(FixedText32 other)

Parameters

  • other

Equals

public override readonly bool Equals(object? obj)

Parameters

  • obj

GetHashCode

public override readonly int GetHashCode()

Operators

implicit operator string

public static implicit operator string(FixedText32 text)

The text text holds.

Parameters

  • text

implicit operator FixedText32

public static implicit operator FixedText32(string? text)

Holds text.

Parameters

  • text

Exceptions

operator ==

public static bool operator ==(FixedText32 left, FixedText32 right)

Whether two hold the same text.

Parameters

  • left
  • right

operator !=

public static bool operator !=(FixedText32 left, FixedText32 right)

Whether two hold other text.

Parameters

  • left
  • right

Constants

Capacity

public const int Capacity = 32

How many bytes of UTF-8 it has room for.