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

Automatically updates a UI RawImage component with a localized texture from the LocalizationManager, based on the current language. More...

Inheritance diagram for Backbone::LocalizedRawImage:

Public Attributes

LocalizedTexture localizedTexture
 Localized texture definition (can use a key or inline values).
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 
void OnDisable ()
 
void UpdateRawImage ()
 Updates the RawImage's texture using the localized value from the manager.
 

Private Attributes

RawImage rawImageComponent
 

Detailed Description

Automatically updates a UI RawImage component with a localized texture from the LocalizationManager, based on the current language.

This component allows runtime switching of UI textures depending on the selected language. It supports direct per-language assignment or centralized key-based lookup via LocalizationManager.

Usage:

  1. Attach this component to a GameObject with a RawImage component (Unity UI).
  2. Set the localizedTexture in the Inspector, using either a key or manual language entries.
  3. When the language changes, the RawImage's texture will be updated accordingly.

Example:

  • Suppose your localization data contains: Key: "background.menu" English: texture_en.png Spanish: texture_es.png
  • In the Inspector: localizedTexture.key = "background.menu"
  • At runtime, the correct texture will be shown depending on the active language.

Notes:

  • This component requires a RawImage component.
  • If the key is not found or the texture is missing, a warning is logged.

Member Function Documentation

◆ Awake()

void Backbone::LocalizedRawImage::Awake ( )
private

◆ OnDisable()

void Backbone::LocalizedRawImage::OnDisable ( )
private

◆ OnEnable()

void Backbone::LocalizedRawImage::OnEnable ( )
private

◆ UpdateRawImage()

void Backbone::LocalizedRawImage::UpdateRawImage ( )
private

Updates the RawImage's texture using the localized value from the manager.

Member Data Documentation

◆ localizedTexture

LocalizedTexture Backbone::LocalizedRawImage::localizedTexture

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

◆ rawImageComponent

RawImage Backbone::LocalizedRawImage::rawImageComponent
private

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