# Sandbox.UI.Label.GetCharacterAtScreenPosition

```csharp
int GetCharacterAtScreenPosition(Vector2 pos)
```

Returns the text element under a screen position, or -1 outside the text.
Unlike caret hit testing, both halves of a character return the same index.

### Parameters

- `pos` (`Vector2`)

### Returns

`int`

Declared in [Sandbox.UI.Label](/api/Sandbox.UI.Label).
Assembly: `Sandbox.Engine`.
