Free Resourcesfilo_textui
DrawText3D
Render a label stack in world space, attached to an entity or fixed coordinates.
Spawns a DUI-backed label rendered as a billboard in the game world. Each call from a resource manages a single label — calling DrawText3D again from the same resource will update the existing label rather than spawn a new one.
Signature
exports.filo_textui:DrawText3D(data)Parameters
| Field | Type | Required | Description |
|---|---|---|---|
entity | number | — | Entity handle to attach the label to. |
coords | vector3 | — | World position for a static (non-entity) label. |
options | table | ✓ | Array of label entries. See Options. |
distance | number | — | Visibility range in units. Default: 8.0. |
entityOffset | vector3 | — | Override the automatic anchor offset relative to the entity. |
Either entity or coords must be provided.
Options
Each entry in the options array:
| Field | Type | Required | Description |
|---|---|---|---|
key | string | — | Key badge character. Supported: E, F, G, H, X. |
label | string | ✓ | Display text. Rendered uppercase. |
Omitting key renders a plain text pill with no badge.
Auto anchor offsets
When entityOffset is not provided, the anchor is calculated from the entity's bounding box:
| Entity type | Anchor offset |
|---|---|
| Ped | vector3(maxX + 0.35, 0.0, 0.0) |
| Vehicle | vector3(maxX + 0.55, 0.0, 0.3) |
Examples
Attached to an entity
exports.filo_textui:DrawText3D({
entity = entityId,
options = {
{ key = 'E', label = 'Interact' },
{ key = 'G', label = 'Options' },
},
})Multiple labels, one without a key
exports.filo_textui:DrawText3D({
entity = entityId,
options = {
{ key = 'E', label = 'Enter Vehicle' },
{ label = 'Locked' },
},
})Fixed world coordinates
exports.filo_textui:DrawText3D({
coords = vector3(100.0, 200.0, 30.0),
distance = 5.0,
options = {
{ key = 'E', label = 'Open' },
},
})Custom anchor offset
exports.filo_textui:DrawText3D({
entity = entityId,
entityOffset = vector3(0.0, 0.0, 1.5),
options = {
{ key = 'F', label = 'Fuel' },
},
})Updating an existing label
Calling DrawText3D from the same resource again will patch the label in-place:
-- Initial show
exports.filo_textui:DrawText3D({
entity = entityId,
options = { { key = 'E', label = 'Lock' } },
})
-- Later — updates without spawning a new DUI
exports.filo_textui:DrawText3D({
entity = entityId,
options = { { key = 'E', label = 'Unlock' } },
})