# Sandbox.Rendering.HudPainter.DrawText

## Overload 1

```csharp
void DrawText(string text, float size, Color color, Vector2 point, TextFlag flags = 33)
```

Draws text at a 3D point with the specified size, color, and alignment flags.

### Parameters

- `text` (`string`): The text to draw.
- `size` (`float`): The font size.
- `color` (`Color`): The color of the text.
- `point` (`Vector2`): The 3D point to draw the text at.
- `flags` (`TextFlag`), default `33`: Text alignment flags (optional).

## Overload 2

```csharp
void DrawText(string text, float size, Color color, Rect rect, TextFlag flags = 33)
```

Draws text within a rectangle with the specified size, color, and alignment flags.

### Parameters

- `text` (`string`): The text to draw.
- `size` (`float`): The font size.
- `color` (`Color`): The color of the text.
- `rect` (`Rect`): The rectangle to draw the text in.
- `flags` (`TextFlag`), default `33`: Text alignment flags (optional).

## Overload 3

```csharp
Rect DrawText(in Scope scope, Vector2 point, TextFlag flags = 33)
```

Draws text at a 3D point using a prepared [Sandbox.TextRendering.Scope](/api/Sandbox.TextRendering.Scope).

### Parameters

- `in scope` (`Scope`): The text rendering scope.
- `point` (`Vector2`): The 3D point to draw the text at.
- `flags` (`TextFlag`), default `33`: Text alignment flags (optional).

### Returns

`Rect`

## Overload 4

```csharp
Rect DrawText(in Scope scope, Rect rect, TextFlag flags = 33)
```

Draws text within a rectangle using a prepared [Sandbox.TextRendering.Scope](/api/Sandbox.TextRendering.Scope).

### Parameters

- `in scope` (`Scope`): The text rendering scope.
- `rect` (`Rect`): The rectangle to draw the text in.
- `flags` (`TextFlag`), default `33`: Text alignment flags (optional).

### Returns

`Rect`

Declared in [Sandbox.Rendering.HudPainter](/api/Sandbox.Rendering.HudPainter).
Assembly: `Sandbox.Engine`.
