> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/classes/class_t_m_pro_1_1_text_mesh_pro.md).

# TMPro::TextMeshPro

**Usage:** `api.TMPro.TextMeshPro.Text(tmp)`

Static helpers around a TMP text label.

## Public Functions

|         | Name                                                                                                                                                                                                                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| string  | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_t_m_pro_1_1_text_mesh_pro.md#function-text"><strong>Text</strong></a>(global::TMPro.TMP\_Text tmp)<br>Returns the current text of the label.</p>                                               |
| void    | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_t_m_pro_1_1_text_mesh_pro.md#function-settext"><strong>SetText</strong></a>(global::TMPro.TMP\_Text tmp, string text)<br>Sets the label's text.</p>                                            |
| float   | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_t_m_pro_1_1_text_mesh_pro.md#function-fontsize"><strong>FontSize</strong></a>(global::TMPro.TMP\_Text tmp)<br>Returns the label's current font size.</p>                                       |
| Vector2 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_t_m_pro_1_1_text_mesh_pro.md#function-getpreferredvalues"><strong>GetPreferredValues</strong></a>(global::TMPro.TMP\_Text tmp)<br>Returns the preferred width/height for the current text.</p> |

## Public Functions Documentation

### function Text

```csharp
static string Text(
    global::TMPro.TMP_Text tmp
)
```

Returns the current text of the label.

**Parameters**:

* **tmp** The text component.

**Return**: Current text.

### function SetText

```csharp
static void SetText(
    global::TMPro.TMP_Text tmp,
    string text
)
```

Sets the label's text.

**Parameters**:

* **tmp** The text component.
* **text** New text.

### function FontSize

```csharp
static float FontSize(
    global::TMPro.TMP_Text tmp
)
```

Returns the label's current font size.

**Parameters**:

* **tmp** The text component.

**Return**: Font size.

### function GetPreferredValues

```csharp
static Vector2 GetPreferredValues(
    global::TMPro.TMP_Text tmp
)
```

Returns the preferred width/height for the current text.

**Parameters**:

* **tmp** The text component.

**Return**: Preferred size.

***

Updated on 2026-07-22 at 12:00:00 +0800
