mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
65 lines
1.3 KiB
Markdown
65 lines
1.3 KiB
Markdown
---
|
|
title: TextUI
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
### lib.showTextUI
|
|
Show the TextUI window.
|
|
|
|
**DO NOT** run this every tick, it's intented to be used as a toggle.
|
|
|
|
```lua
|
|
-- text: string
|
|
-- options: table (optional)
|
|
-- position: "right-center" or "left-center" or "top-center" (default - "right-center")
|
|
-- icon: string or table
|
|
-- iconColor: string
|
|
-- style: React.CSSProperties
|
|
lib.showTextUI(text, options)
|
|
```
|
|
|
|
**Example:**
|
|
<Tabs>
|
|
<TabItem label="Basic" value="basic">
|
|
|
|
```lua
|
|
lib.showTextUI('[E] - Fuel vehicle')
|
|
```
|
|
|
|

|
|
</TabItem>
|
|
<TabItem label="Custom style" value="custom">
|
|
|
|
```lua
|
|
lib.showTextUI('[E] - Pick apple', {
|
|
position = "top-center",
|
|
icon = 'hand',
|
|
style = {
|
|
borderRadius = 0,
|
|
backgroundColor = '#48BB78',
|
|
color = 'white'
|
|
}
|
|
})
|
|
```
|
|
|
|

|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
The icon library used is Font Awesome 6.0, if for the icon you define only a string
|
|
the default icon type will be `solid`.
|
|
If you want to use a different icon type, i.e
|
|
apple as a brand, you need to define icon as a table with the first value being
|
|
the icon type as a string, and the second being the icon name.
|
|
|
|
`icon = {'fab', 'apple'}`
|
|
|
|
### lib.hideTextUI
|
|
Hides the currently visible TextUI window
|
|
|
|
```lua
|
|
lib.hideTextUI()
|
|
```
|