Skip to content

Latest commit

 

History

History
134 lines (90 loc) · 2.73 KB

OsmiumLibraryDocumentation.md

File metadata and controls

134 lines (90 loc) · 2.73 KB

Osmium Library Documentation

local _, library = pcall(loadstring(game:HttpGet("https://raw.githubusercontent.com/TrixAde/Osmium/main/OsmiumLibrary.lua")))

Window

Create a Window

library:CreateWindow(title: string) -> Window

local window = library:CreateWindow("Osmium UI Library")

Get Window State

Window:GetCurrentState() -> number

local state = window:GetCurrentState()

if state == library.WindowState.Destroyed then
    print("Window closed")
end

Possibles values :

  • library.WindowState.Destroyed: the window is closed
  • library.WindowState.Oppenned: the window is openned
  • library.WindowState.Minimized: the window is openned and minimized

Destroy Window

Window:Destroy()

window:Destroy()

Tab

Create a Tab

Window:CreateTab(name: string) -> Tab

local tab = window:CreateTab("Demo Tab")

Create a Text Label

Tab:CreateLabel(text?: string, description?: string) -> TextLabel

local label = tab:CreateLabel("Title Exemple","Description Exemple")

Update Title

TextLabel:SetTitle(text?: string) -> TextLabel

label:SetTitle("Title")

Update Description

TextLabel:SetDescription(text?: string) -> TextLabel

label:SetDescription("Description")

Create a Toggle

Tab:CreateToggle(text: string, default?: boolean, callback?: function (boolean)) -> Toggle

local toggle = tab:CreateToggle("Toggle Exemple", false, function (value)
    print("Value changed to", value)
end)

Create a Text Box

Tab:CreateTextBox(text: string, callback?: function (string), placeholder?: string) -> TextBox

local textbox = tab:CreateTextbox("TextBox Exemple", function(value)
    print("Value = ", value)
end, "Write Here")

Create a Button

Tab:CreateButton(text: string, callback?: function ()) -> Button

local button = tab:CreateButton("Button Exemple", function()
    print("Clicked")
end)

Create a Slider

Tab:CreateSlider(text: string, minvalue: number, maxvalue: number, callback?: function ()) -> Slider

local slider = tab:CreateSlider("Slider Exemple",0,100,function(arg)
	print(arg)
end)

Create a DropDown

Tab:CreateDropdown(text: string, values?: table, callback?: function ()) -> Slider

local dropdown = tab:CreateDropdown("DropDown Exemple",{"Button 1","Button 2","Button 3"},function(val)
    print(val)
end)