diff --git a/docs/ox_lib/Client/Interface/textui.md b/docs/ox_lib/Client/Interface/textui.md new file mode 100644 index 00000000..e0f310bb --- /dev/null +++ b/docs/ox_lib/Client/Interface/textui.md @@ -0,0 +1,64 @@ +--- +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:** + + + +```lua +lib.showTextUI('[E] - Fuel vehicle', { + position = "top-center", + icon = "gas-pump", +}) +``` + + + +```lua +lib.showTextUI('[E] - Pick apple', { + position = "top-center", + icon = 'hand', + iconColor = "red", + style = { + borderRadius = 0, + backgroundColor = 'blue', + color = 'red' + } +}) +``` + + + +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() +``` diff --git a/docs/ox_lib/Client/index.md b/docs/ox_lib/Client/index.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/ox_lib/Server/index.md b/docs/ox_lib/Server/index.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/ox_lib/index.md b/docs/ox_lib/index.md index e69de29b..302ea33a 100644 --- a/docs/ox_lib/index.md +++ b/docs/ox_lib/index.md @@ -0,0 +1,27 @@ +--- +title: Getting Started +--- + +ox_lib is a collection of Lua and UI functions to utilise in other resources. + +The UI is built in React so the code needs to be compiled into standard JS. +If you don't know how to do this then please download the [release](https://github.com/overextended/ox_lib/releases/latest) (ox_lib.zip) which is *already* compiled into a working resource. + +To enable the library inside of your resource just add `@ox_lib/init.lua` to `shared_scripts` or +a `shared_script` in your `fxmanifest.lua` file. + +```lua +shared_scripts { + '@ox_lib/init.lua' +} +``` + +Or if the library is the only shared script you use you can do: + +```lua +shared_script '@ox_lib/init.lua' +``` + +That's it! +You can now use the library functions inside of your resource, check the rest of the +documentation to see how to utilise them. \ No newline at end of file