Scripting API
Scripting API
FixedText256
Struct in Abyss.Core, from Abyss.Core.
Text of up to 256 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 FixedText256Remarks
Made from a string, FixedText256 name = "Sword";, and read back with FixedText256.ToString. A string that takes more than 256 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
FixedText256
public FixedText256(string? text)Holds text.
Parameters
text
Exceptions
ArgumentException: It takes more thanFixedText256.Capacitybytes, or holds a zero.
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(FixedText256 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(FixedText256 text)The text text holds.
Parameters
text
implicit operator FixedText256
public static implicit operator FixedText256(string? text)Holds text.
Parameters
text
Exceptions
ArgumentException: It takes more thanFixedText256.Capacitybytes, or holds a zero.
operator ==
public static bool operator ==(FixedText256 left, FixedText256 right)Whether two hold the same text.
Parameters
leftright
operator !=
public static bool operator !=(FixedText256 left, FixedText256 right)Whether two hold other text.
Parameters
leftright
Constants
Capacity
public const int Capacity = 256How many bytes of UTF-8 it has room for.
