# Currency Element UGUI

## 💰 CurrencyElementUGUI Class

A currency element for uGUI support.

> **Namespace:** `Esper.Inventool.UI.UGUI`\
> **Access:** `public`\
> **Type:** `class`\
> **Inherits:** `MonoBehaviour`

***

### 📦 Fields

| Access   | Field           | Type              | Description                                      |
| -------- | --------------- | ----------------- | ------------------------------------------------ |
| `public` | `rectTransform` | `RectTransform`   | The RectTransform.                               |
| `public` | `icon`          | `Image`           | Image component that displays the currency icon. |
| `public` | `amountLabel`   | `TextMeshProUGUI` | TMP component that displays the currency amount. |

***

### 🧰 Methods

| Access    | Method                              | Returns       | Description                                    |
| --------- | ----------------------------------- | ------------- | ---------------------------------------------- |
| `private` | `Awake()`                           | `void`        | Subscribes to `amountLabel.OnPreRenderText`.   |
| `private` | `OnPreRenderText(TMP_TextInfo obj)` | `void`        | Starts resizing after TMP pre‑render event.    |
| `private` | `Resize()`                          | `IEnumerator` | Resizes the RectTransform and rebuilds layout. |
