mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
155 lines
2.0 KiB
Plaintext
155 lines
2.0 KiB
Plaintext
---
|
|
title: TextUI
|
|
---
|
|
|
|
import { Tabs, Tab } from 'nextra-theme-docs';
|
|
import { Callout } from 'nextra/components';
|
|
|
|
### lib.showTextUI
|
|
|
|
Show the TextUI window.
|
|
|
|
<Callout type="warning">
|
|
|
|
**DO NOT** run this function every tick, it's intented to be used as a toggle.
|
|
|
|
</Callout>
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.showTextUI(text, options)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
lib.showTextUI(text, options);
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
- text: `string`
|
|
- options?: `table`
|
|
- position?: `'right-center'` or `'left-center'` or `'top-center'`
|
|
- Default: `'right-center'`
|
|
- icon?: `string` or `table` (`array`)
|
|
- iconColor?: `string`
|
|
- style?: React.CSSProperties
|
|
|
|
### lib.hideTextUI
|
|
|
|
Hides the currently visible TextUI window
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.hideTextUI()
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
lib.hideTextUI();
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Usage Example
|
|
|
|
#### Basic
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.showTextUI('[E] - Fuel vehicle')
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
lib.showTextUI('[E] - Fuel vehicle');
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|

|
|
|
|
#### Custom styling
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.showTextUI('[E] - Pick apple', {
|
|
position = "top-center",
|
|
icon = 'hand',
|
|
style = {
|
|
borderRadius = 0,
|
|
backgroundColor = '#48BB78',
|
|
color = 'white'
|
|
}
|
|
})
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
lib.showTextUI('[E] - Pick apple', {
|
|
position: 'top-center',
|
|
icon: 'hand',
|
|
style: {
|
|
borderRadius: 0,
|
|
backgroundColor: '#48BB78',
|
|
color: 'white',
|
|
},
|
|
});
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### lib.isTextUIOpen
|
|
|
|
Returns whether Text UI is opened or not
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.isTextUIOpen()
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
lib.isTextUIOpen();
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
|
|

|