# textui

## Text UI

<figure><img src="https://share.lvsoft.com.ar/images/oeutw.jpg" alt=""><figcaption></figcaption></figure>

***

### How to use:

Client side using exports

**Example:**

```lua
-- show up the textui
exports.lvs_lib:showTextUI(text, key)

-- update the text and key on the visible textui
exports.lvs_lib:updateTextUI(text, key)

-- effect on the key
exports.lvs_lib:pressedTextUI()

-- hide the textui
exports.lvs_lib:hideTextUI()

-- state of the textui
local isOpen, text = exports.lvs_lib:isOpenTextUI()
```

***

### QBCore Integration:

Replace entire `qb-core/client/drawtext.lua` with:

```lua
local function drawText(text, position)
    exports.lvs_lib:showTextUI(text)
end

local function changeText(text, position)
    exports.lvs_lib:updateTextUI(text)
end

local function keyPressed()
    exports.lvs_lib:pressedTextUI()
end

local function hideText()
    exports.lvs_lib:hideTextUI()
end

RegisterNetEvent('qb-core:client:DrawText', function(text, position)
    drawText(text, position)
end)

RegisterNetEvent('qb-core:client:ChangeText', function(text, position)
    changeText(text, position)
end)

RegisterNetEvent('qb-core:client:HideText', function()
    hideText()
end)

RegisterNetEvent('qb-core:client:KeyPressed', function()
    keyPressed()
end)

exports('DrawText', drawText)
exports('ChangeText', changeText)
exports('HideText', hideText)
exports('KeyPressed', keyPressed)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fivem.lvsoft.com.ar/qb-esx/lvs-lib/textui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
