Files
overextended.github.io/docs/ox_lib/Interface/Client/textui.md
T
BerkieBb 99b434663f feat(ox_lib/textui): isTextUIOpen (#56)
* feat(ox_lib/interface/textui): isTextUIOpen

* fix(ox_lib/interface/textui): ummm
2022-10-14 17:33:29 +02:00

2.0 KiB

title
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.

lib.showTextUI(text, options)
import lib from '@overextended/ox_lib/client'

lib.showTextUI(text, options)
  • 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

Usage Example

Basic

lib.showTextUI('[E] - Fuel vehicle')
import lib from '@overextended/ox_lib/client'

lib.showTextUI('[E] - Fuel vehicle')

Custom styling

lib.showTextUI('[E] - Pick apple', {
    position = "top-center",
    icon = 'hand',
    style = {
        borderRadius = 0,
        backgroundColor = '#48BB78',
        color = 'white'
    }
})
import lib from '@overextended/ox_lib/client'

lib.showTextUI('[E] - Pick apple', {
  position: "top-center",
  icon: 'hand',
  style: {
    borderRadius: 0,
    backgroundColor: '#48BB78',
    color: 'white'
  }
})

lib.hideTextUI

Hides the currently visible TextUI window

lib.hideTextUI()
import lib from '@overextended/ox_lib/client'

lib.hideTextUI()

lib.isTextUIOpen

Returns if the TextUI window is open

local isOpen = lib.isTextUIOpen()
print(isOpen)
import lib from '@overextended/ox_lib/client'

let isOpen = lib.isTextUIOpen()
console.log(isOpen)