Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-v2Interface APIs

Text UI

Show persistent DynamicHUD interaction prompts and replace ox_lib Text UI calls.

Text UI

Text UI displays a persistent interaction prompt. Show it once when an interaction becomes available and hide it when the player leaves. Do not call showTextUI every frame.

Client exports
exports['orbit-dynamichud-v2']:showTextUI('[E] Open garage', {
    position = 'right-center',
    icon = 'fas fa-warehouse',
    iconColor = '#71B6F7'
})

-- When the interaction is no longer available:
exports['orbit-dynamichud-v2']:hideTextUI()

The event form is useful from bridge resources:

Client events
TriggerEvent('orbit-dynamichud:showTextUI', '{key:E} Open garage', {
    position = 'left-center'
})

TriggerEvent('orbit-dynamichud:hideTextUI')

A server script can target one player with the same events:

Server events
TriggerClientEvent('orbit-dynamichud:showTextUI', source, '[E] Continue')
TriggerClientEvent('orbit-dynamichud:hideTextUI', source)

Options

OptionTypeDefaultDescription
positionstring?"right-center"right-center, left-center, top-center, or bottom-center.
icon`stringstring[]?`none
iconColorstring?whiteCSS icon color.
iconAnimationstring?nonespin, spinPulse, spinReverse, pulse, beat, fade, beatFade, bounce, or shake.
alignIconstring?"center"center or top.
styletable?noneSanitized CSS overrides. Camel-case names are accepted; numeric dimensions become pixels.

Use [E] or {key:E} to render a key marker. Newlines create multiple lines.

Multiline prompt
exports['orbit-dynamichud-v2']:showTextUI('{key:E} Search\nPolice may be alerted', {
    position = 'bottom-center',
    icon = { 'fas', 'fa-magnifying-glass' },
    iconAnimation = 'pulse',
    alignIcon = 'top',
    style = {
        maxWidth = '28vh',
        opacity = 0.95
    }
})

Query its state and current text:

local isOpen, currentText = exports['orbit-dynamichud-v2']:isTextUIOpen()

ox_lib drop-in replacement

client/orbit_textui.lua
lib = lib or {}

lib.showTextUI = function(text, options)
    return exports['orbit-dynamichud-v2']:showTextUI(text, options)
end

lib.hideTextUI = function()
    return exports['orbit-dynamichud-v2']:hideTextUI()
end

lib.isTextUIOpen = function()
    return exports['orbit-dynamichud-v2']:isTextUIOpen()
end

This preserves the ox_lib signatures and both return values from lib.isTextUIOpen(). Existing calls require no edits.

Showing new text replaces the active prompt. Explicitly call hideTextUI during interaction cleanup and resource stop.

On this page