Koja Scripts
KOJA-LIB

Text UI

A small on-screen prompt that shows an action key and a label.

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)
FieldTypeDefaultDescription
keystring"E"Key name displayed on the prompt
labelstring"Action"Short label next to the key
descstring"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

  • openboolean
  • currenttable | nil — the data passed to the last showTextUI call

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,
})
  • 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.