Update Library/README.md

This commit is contained in:
Apapapa 2025-02-20 11:36:23 +00:00
parent a68150492a
commit 08765aa5d4

View File

@ -0,0 +1,162 @@
# Orion Library
This documentation is for the stable release of Orion Library.
## Booting the Library
```lua
local JustHub = loadstring(game:HttpGet(('https://git.warceuproject.org/Apapapa/AutoFarm/raw/branch/main/Library/testing2.lua')))()
```
## Creating a Window
```lua
JustHub:InitializeUI({Name = "Just Hub", Theme = "Purple"})
wait(6) --Timer Loading Screen
if not JustHub.Window then
warn("Window belum dibuat.")
return
end
local window = JustHub.Window
--[[
Name = <string> - The name of the UI.
Theme = <Darker> - Themes(Colors Ui)
List Theme > Darker,Dark,Purple,Light,Neon
]]
```
## Creating a Tab
```lua
local Tab = window:addTab("•Home")
--[[
local Tab = window:addTab("Your Name Tabs") - The name of the tab.
]]
```
## Creating a Section
```lua
local Section = Tab:addSection("Home Section", 120)
--[[
local Section = Tab:addSection("Your Name Section", 120) - The name of the section and size.
]]
```
## Notifying the user
```lua
JustHub:Notify({
Title = "Notification",
Message = "UI berhasil dibuat!",
Duration = 5}),
--[[
Title = <string> - The title of the notification.
Message = <string> - The content of the notification.
Duration = <number> - The duration of the notfication.
]]
```
## Creating a Button
```lua
Section:addButton({
Name = "Execute",
ButtonText = "Run",
Callback = function()
print("Button clicked!")
end
})
--[[
Name = <string> - The name of the button.
ButtonText = <string> - The name of button
Callback = <function> - The function of the button.
]]
```
## Creating a Checkbox toggle
```lua
Section:addToggle({
Name = "Toggle",
Default = false,
Callback = function(state)
print("Toggle state:", state)
end
})
--[[
Name = <string> - The name of the toggle.
Default = <bool> - The default value of the toggle.
Callback = <function> - The function of the toggle
--)]]
```
## Creat Slider
```Lua
Section:addSlider({
Name = "Slider Example",
Min = 0,
Max = 100,
Default = 50,
Callback = function(value)
print("Slider value:", value)
end
})
--[[
Name = <string> - The name of the slider.
Min = <number> - The minimal value of the slider.
Max = <number> - The maxium value of the slider.
Default = <number> - The default value slider
Callback = <function> - The function of the slider.
]]
```
## Creating an Textbox Input
```lua
Section:AddTextbox({
Name = "Textbox",
Default = "default box input",
Callback = function(Value)
print(Value)
end
})
--[[
Name = <string> - The name of the textbox.
Default = <string> - The default value of the textbox.
Callback = <function> - The function of the textbox.
]]
```
## Creating a Dropdown menu
```lua
Section:addDropdown({
Name = "Dropdown Example",
Default = "",
Items = {"Option 1", "Option 2", "Option 3"},
Callback = function(selected)
print("Dropdown selected:", selected)
end
})
--[[
Name = <string> - The name of the dropdown.
Default = <string> - The default value of the dropdown.
Items = <table> - The options in the dropdown.
Callback = <function> - The function of the dropdown.
]]
```
## Destroying the Interface
```lua
JustHub:Destroy()
```