# cx\_textui

<div align="center" data-full-width="false"><figure><img src="/files/G9aubJkOlaVOPJAJqLYF" alt=""><figcaption></figcaption></figure> <figure><img src="/files/u43VVQzxz3OGkzFPk1Uf" alt=""><figcaption></figcaption></figure></div>

## Installation and Usage

### Displaying

{% code lineNumbers="true" %}

```lua
exports.["cx_textui"]:Open("E","OPEN CLOTHING","#fff","bottom") 
-- Open(key,message,color,position)
```

{% endcode %}

### Hiding&#x20;

{% code lineNumbers="true" %}

```lua
exports.["cx_textui"]:Close()
```

{% endcode %}

## 🔼 Positions

`top` - `bottom` - `right` - `left`

## 🎨Color

Any Hex Color

## ⚙ Config

Default Position and Color

{% code title="config.lua" lineNumbers="true" %}

```lua
uiConfig = {
    position = "bottom",
    defaultcolor = "#4d0dff"
}
```

{% endcode %}

## Example&#x20;

{% code title="your-client.lua" %}

```lua
local shown = false
local inDistance = false

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        inDistance = false
        local coords = GetEntityCoords(PlayerPedId())
        local distance = #(coords - vector3(-457.753845, -670.588989, 32.093750))
		DrawMarker(3, -457.753845, -670.588989, 32.093750, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 1.0, 1.0, 1.0, 50, 50, 255, 90, false, true, 2, nil, nil, false)
        if distance <= 1 then
            inDistance = true	
            -- Your Code Goes Here		
        else
            inDistance = false
            -- Your Code Goes Here
        end

        if not shown and inDistance then
            exports.cx_textui:Open(
                "TAB",
                "OPEN MENU",
		"#fff",
		"bottom"
            )
            shown = true
        elseif shown and not inDistance then
            exports.cx_textui:Close()
            shown = false
        end
    end
end)
```

{% endcode %}


---

# 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://canx-1.gitbook.io/canx/paid-scripts-guide/cx_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.
