Backbone - Localization
 
Loading...
Searching...
No Matches
Backbone::LocalizedTMP_Text Class Reference

Automatically updates a TMP_Text component with a localized string from the LocalizationManager, based on the current language. More...

Inheritance diagram for Backbone::LocalizedTMP_Text:

Public Attributes

LocalizedString localizedString
 Localized string definition (can use a key or inline values).
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 
void OnDisable ()
 
void UpdateText ()
 Updates the TMP_Text content using the localized value from the manager.
 

Private Attributes

TMP_Text tmpText
 

Detailed Description

Automatically updates a TMP_Text component with a localized string from the LocalizationManager, based on the current language.

This component supports both key-based and inline per-language string definitions via a LocalizedString reference.

Usage:

  1. Attach this script to a GameObject with a TMP_Text component.
  2. Assign a LocalizedString in the Inspector (either using a key or manual language entries).
  3. When the language changes, the text updates automatically.

Example:

  • localizedString.key = "menu.title"
  • English: "Start Game"
  • Spanish: "Iniciar Juego"

Notes:

  • Requires a TMP_Text component (from TextMeshPro).
  • Displays a warning if no localized string is found.

Member Function Documentation

◆ Awake()

void Backbone::LocalizedTMP_Text::Awake ( )
private

◆ OnDisable()

void Backbone::LocalizedTMP_Text::OnDisable ( )
private

◆ OnEnable()

void Backbone::LocalizedTMP_Text::OnEnable ( )
private

◆ UpdateText()

void Backbone::LocalizedTMP_Text::UpdateText ( )
private

Updates the TMP_Text content using the localized value from the manager.

Member Data Documentation

◆ localizedString

LocalizedString Backbone::LocalizedTMP_Text::localizedString

Localized string definition (can use a key or inline values).

◆ tmpText

TMP_Text Backbone::LocalizedTMP_Text::tmpText
private

The documentation for this class was generated from the following file: