![]() |
tModLoader v2025.03
A mod to make and play Terraria mods
|
Represents text that will be sent over the network in multiplayer and displayed to the receiving user in their selected language. Use FromKey(string, object[]) to send a localization key and optional substitutions. LocalizedText.ToNetworkText() can be used directly as well for the same effect.Use FromFormattable(string, object[]) to send a string with string formatting substitutions and associated substitutions. This is typically used with language-agnostic strings that don't need a localization entry, such as "{0} - {1}".Use FromLiteral(string) to send a string directly. This should be used to send text that can't be localized. More...
Public Member Functions | |
int | GetMaxSerializedSize () |
void | Serialize (BinaryWriter writer) |
override string | ToString () |
Static Public Member Functions | |
static NetworkText | Deserialize (BinaryReader reader) |
static NetworkText | DeserializeLiteral (BinaryReader reader) |
static NetworkText | From (object o) |
static NetworkText | FromFormattable (string text, params object[] substitutions) |
Creates a NetworkText object from a string with string formatting substitutions and associated substitutions. This is typically used with language-agnostic strings that don't need a localization entry, such as "{0} - {1}". More... | |
static NetworkText | FromKey (string key, params object[] substitutions) |
Creates a NetworkText object from a localization key and optional substitutions. The receiving client will see the resulting text in their selected language. More... | |
static NetworkText | FromLiteral (string text) |
Creates a NetworkText object from a string. Use this for text that can't be localized. More... | |
Static Public Attributes | |
static readonly NetworkText | Empty = FromLiteral("") |
Represents text that will be sent over the network in multiplayer and displayed to the receiving user in their selected language.
Use FromKey(string, object[]) to send a localization key and optional substitutions. LocalizedText.ToNetworkText() can be used directly as well for the same effect.
Use FromFormattable(string, object[]) to send a string with string formatting substitutions and associated substitutions. This is typically used with language-agnostic strings that don't need a localization entry, such as "{0} - {1}".
Use FromLiteral(string) to send a string directly. This should be used to send text that can't be localized.
|
static |
Creates a NetworkText object from a string with string formatting substitutions and associated substitutions. This is typically used with language-agnostic strings that don't need a localization entry, such as "{0} - {1}".
text | |
substitutions |
|
static |
Creates a NetworkText object from a localization key and optional substitutions. The receiving client will see the resulting text in their selected language.
key | |
substitutions |
|
static |
Creates a NetworkText object from a string. Use this for text that can't be localized.
text |