Text UI
A small on-screen prompt that shows an action key and a label. Typically used near interaction zones.
showTextUI
Show the Text UI.
showTextUI(data)
-- or via export:
exports['koja-lib']:showTextUI(data)
| Field | Type | Default | Description |
|---|---|---|---|
key | string | "E" | Key name displayed on the prompt |
label | string | "Action" | Short label next to the key |
desc | string | "Press to perform action" | Description text |
hideTextUI
Hide the Text UI.
hideTextUI()
-- or via export:
exports['koja-lib']:hideTextUI()
isTextUIOpen
Returns whether the Text UI is currently visible and the current data.
local open, current = isTextUIOpen()
-- or via export:
local open, current = exports['koja-lib']:isTextUIOpen()
Returns
open—booleancurrent—table | nil— the data passed to the lastshowTextUIcall
Theme
Config.UI.TextUI = {
theme = "darkBlack", -- orange | darkGray | darkBlack | navy | green | purple | red
bottomOffset = 5.5,
}
Example
local point = KOJA.Client.points.new({
coords = vector3(100.0, 200.0, 30.0),
distance = 2.0,
onEnter = function(self)
showTextUI({
key = 'E',
label = 'ATM',
desc = 'Access your bank account',
})
end,
onExit = function(self)
hideTextUI()
end,
})
Related pages
- Getting Started — Configuration and Installation for Getting Started.
- API Reference — Client API and Server API for API Reference.
- Frameworks — Custom Framework and Overview for Frameworks.
- Inventory — Custom Inventory and Overview for Inventory.
- Weapon — Utility function for reading the player's current weapon state.
- Vehicle — Utility functions for reading vehicle state on the client.