Skip to content

UI Toolkit Integration

Requirements: UI Toolkit 1.0.0+ (Unity 2022.2+)

LocalizedLabel

Custom UI Toolkit element for localized text.

UXML Usage:

xml
<ui:UXML xmlns:lexis="Lexis.UIToolkit">
    <lexis:LocalizedLabel localization-key="ui.title" />
    <lexis:LocalizedLabel table-id="menu" localization-key="start.button" />
</ui:UXML>

C# Usage:

csharp
var label = new LocalizedLabel("ui.title");
label.SetArguments(playerName);
root.Add(label);

UXML Attributes:

AttributeTypeDescription
localization-keystringThe translation key
table-idstringOptional table identifier

LocalizedImage

Custom UI Toolkit element for localized sprites/textures.

UXML Usage:

xml
<lexis:LocalizedImage table-id="assets" asset-key="flag-icon" />

UXML Attributes:

AttributeTypeDescription
table-idstringAsset table identifier
asset-keystringAsset entry key

Professional Unity Development Tools