Skip to Content

Text UI

Persistent on-screen text overlays with key hints and icons.

Client Exports

showTextUI

Display a text overlay on screen.

exports['trinity-ui']:showTextUI(text, options)

Parameters:

ParameterTypeDescription
textstring | tableDisplay text, or table with all properties
optionstableDisplay options (optional)

Options:

PropertyTypeDefaultDescription
positionstringConfig value'right-center' | 'left-center' | 'top-center' | 'bottom-center'
iconstringIconify icon name
iconColorstringIcon color (hex)
alignIconstring'top' | 'center'
stylestring | tableCustom CSS styles
keystringKey hint badge (auto-extracted from [E] patterns)

hideTextUI

Hide the text overlay.

exports['trinity-ui']:hideTextUI()

isTextUIOpen

Check if the text UI is currently visible.

local open = exports['trinity-ui']:isTextUIOpen()

Server-Side Usage

-- Show TextUI for a specific player trinity.showTextUI(source, data) -- Hide TextUI for a specific player trinity.hideTextUI(source)

Examples

Simple Text

exports['trinity-ui']:showTextUI('Press [E] to interact')

The [E] is automatically extracted and displayed as a key badge.

With Icon

exports['trinity-ui']:showTextUI('Open Shop', { icon = 'fa6-solid:store', position = 'right-center' })

With Custom Styling

exports['trinity-ui']:showTextUI({ text = 'Restricted Area', icon = 'fa6-solid:triangle-exclamation', iconColor = '#ff0000', style = { backgroundColor = 'rgba(255, 0, 0, 0.1)', borderColor = '#ff0000' } })

Hide When Leaving Area

-- Show when entering area exports['trinity-ui']:showTextUI('Press [E] to enter garage', { icon = 'fa6-solid:warehouse' }) -- Hide when leaving exports['trinity-ui']:hideTextUI()

ox_lib compatibility events ox_lib:showTextUI and ox_lib:hideTextUI are also supported automatically.

Last updated on