-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathExample.lua
More file actions
43 lines (38 loc) · 1.41 KB
/
Example.lua
File metadata and controls
43 lines (38 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- Load the DrRay library from the GitHub repository Library
local DrRayLibrary = loadstring(game:HttpGet("https://raw.githubusercontent.com/AZYsGithub/DrRay-UI-Library/main/DrRay.lua"))()
-- Create a new window and set its title and theme
local window = DrRayLibrary:Load("DrRay!", "Default")
-- Create the first tab with an image ID
local tab1 = DrRayLibrary.newTab("Tab 1", "ImageIdHere")
-- Add elements to the first tab
tab1.newLabel("Hello, this is Tab 1.")
tab1.newButton("Button", "Prints Hello!", function()
print('Hello!')
end)
tab1.newToggle("Toggle", "Toggle! (prints the state)", true, function(toggleState)
if toggleState then
print("On")
else
print("Off")
end
end)
tab1.newInput("Input", "Prints your input.", function(text)
print("Entered text in Tab 1: " .. text)
end)
-- Create the second tab with a different image ID
local tab2 = DrRayLibrary.newTab("Tab 2", "ImageIdLogoHere")
-- Add elements to the second tab
tab2.newLabel("Hello, this is Tab 2.")
tab2.newButton("Button", "Prints Hello!", function()
print('Hello!')
end)
tab2.newToggle("Toggle", "Toggle! (prints the state)", true, function(toggleState)
if toggleState then
print("On")
else
print("Off")
end
end)
tab2.newDropdown("Dropdown", "Select one of these options!", {"water", "dog", "air", "bb", "airplane", "wohhho", "yeay", "delete"}, function(selectedOption)
print(selectedOption)
end)