filo studios.
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

FieldTypeRequiredDescription
entitynumberEntity handle to attach the label to.
coordsvector3World position for a static (non-entity) label.
optionstableArray of label entries. See Options.
distancenumberVisibility range in units. Default: 8.0.
entityOffsetvector3Override the automatic anchor offset relative to the entity.

Either entity or coords must be provided.

Options

Each entry in the options array:

FieldTypeRequiredDescription
keystringKey badge character. Supported: E, F, G, H, X.
labelstringDisplay 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 typeAnchor offset
Pedvector3(maxX + 0.35, 0.0, 0.0)
Vehiclevector3(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' } },
})

On this page