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:
| Parameter | Type | Description |
|---|---|---|
text | string | table | Display text, or table with all properties |
options | table | Display options (optional) |
Options:
| Property | Type | Default | Description |
|---|---|---|---|
position | string | Config value | 'right-center' | 'left-center' | 'top-center' | 'bottom-center' |
icon | string | — | Iconify icon name |
iconColor | string | — | Icon color (hex) |
alignIcon | string | — | 'top' | 'center' |
style | string | table | — | Custom CSS styles |
key | string | — | Key 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