# Drawtext

Display roleplay messages **above player heads** in 3D.

### ✨ Features

* 📍 **Distance-based:** Visible up to 30m
* 🎨 **Color matched:** Same as message color
* ⏱️ **Auto fade:** Disappears after 5 seconds
* 🔍 **Smart scaling:** Smaller at distance
* ⚡ **Performance optimized:** Auto-cleanup

### 🎮 Which Commands?

Drawtext is enabled for:

* ✅ `/me` - Pink
* ✅ `/do` - Purple
* ✅ `/ooc` - White
* ❌ `/adminchat` - Disabled

### ⚙️ Configuration

Edit `config/config.lua`:

```lua
Config.AboveHead = {
    fontSize = 0.35,
    offsetZ = 0.4,
    outlineEnabled = true
}

Config.Me = {
    showAboveHead = true,
    aboveHeadDuration = 5000,  -- 5 seconds
    range = 20.0
}
```

### 🔧 Toggle In-Game

Players can disable via `/chatset`:

1. Open settings
2. Toggle "Drawtext" off
3. No more 3D text for them

### 📊 Performance Impact

* **Idle:** 0.00 ms
* **1 player visible:** \~0.05 ms
* **5 players visible:** \~0.15 ms

> ⚡ Optimized with conditional rendering and distance culling.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://elena-scripts.gitbook.io/elenascripts/core-systems/chat/drawtext.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
