Overview
The Roblox Enhanced UI Library is the official UI framework for all Roblox Enhanced scripts. Every script published on our platform must use this library to ensure consistency and quality across all user interfaces. It provides a modern, sleek design with easy-to-use components for building complex user interfaces.
Getting Started
To use the UI Library, simply load the library:
local EnhancedUI = loadstring(game:HttpGet("https://renhanced.deitsuki.games/uilib"))()
Then create a new window:
local window = EnhancedUI.Window.new({title = "My Menu"})
Create tabs and add components:
local mainTab = window:CreateTab({name = "Main"})
local button = mainTab:CreateButton({text = "Click Me", callback = function() print("Button clicked!") end})
Window Class
The Window class represents the main UI window.
Window.new({title})
Creates a new window with the specified title.
window:CreateTab({name})
Creates a new tab in the window.
window:ChangeTab(name)
Switches to the specified tab.
window:SendNotification({text, duration})
Displays a notification message.
window:Toggle()
Toggles the visibility of the window.
window:Destroy()
Destroys the window and cleans up resources.
Tab Class
The Tab class represents a tab within a window, containing various UI components.
tab:CreateTitle({text})
Creates a title element.
tab:CreateText({text})
Creates a text element.
tab:CreateButton({text, callback})
Creates a button.
tab:CreateToggle({text, callback, default})
Creates a toggle switch.
tab:CreateInput({text, callback, default})
Creates a text input field.
tab:CreateDropdown({text, items, default, callback})
Creates a dropdown selection.
tab:CreateMultiSelect({text, items, default, callback})
Creates a multi-select dropdown.
All UI components, returns their respective objects.
Each component have a :Destroy() method to remove it from the UI.
Components
This section provides detailed information about each UI component available in the library.
Button
A clickable button that executes a callback function when pressed.
Methods:
- SetText(newText): Sets the button text to 'newText'
- SetCallback(newCallback): Sets the callback function to 'newCallback'
- Trigger(): Simulates a button click
- Destroy(): Removes the button from the UI
Example:
local button = tab:CreateButton({text = "Activate", callback = function()
print("Button activated!")
end})
button:SetText("Deactivate") -- Change text later
Toggle
A switch that can be on or off, useful for enabling/disabling features.
Methods:
- Set(newValue): Sets the toggle state to 'newState'
- Get(): Returns the current state of the toggle
- SetText(newText): Sets the toggle text to 'newText'
- SetCallback(newCallback): Sets the callback function to 'newCallback'
- Destroy(): Removes the toggle from the UI
Example:
local toggle = tab:CreateToggle({text = "Auto Farm", default = false, callback = function(state)
if state then
startFarming()
else
stopFarming()
end
end})
print("Current state:" .. toggle:Get()) -- false
Input
A text input field for user text entry.
Methods:
- Set(newContent): Sets the input field text to 'newContent'
- Get(): Returns the current text in the input field
- SetText(newPlaceholder): Sets the input field placeholder text to 'newPlaceholder'
- SetCallback(newCallback): Sets the callback function to 'newCallback'
- Destroy(): Removes the input from the UI
Example:
local input = tab:CreateInput({text = "Enter username", default = "Player123", callback = function(text)
print("Username entered:" .. text)
end})
input:Set("NewPlayer") -- Change value
Dropdown
A single-selection dropdown menu.
Methods:
- Set(newItem): Sets the selected item to the value or index 'newItem'
- Get(): Returns the current selected item and its index
- SetItems(newItems, idx): Updates the dropdown items and optionally sets the selected index
- SetText(newText): Sets the dropdown text to 'newText'
- SetCallback(newCallback): Sets the callback function to 'newCallback'
- Destroy(): Removes the dropdown from the UI
Example:
local dropdown = tab:CreateDropdown({text = "Difficulty", items = {"Easy", "Medium", "Hard"}, default = 1, callback = function(selected, index)
print("Selected:" .. selected .. "at index" .. index)
end})
dropdown:Set("Hard") -- Select "Hard"
print(dropdown:Get().value .. ", " .. dropdown:Get().index) -- Print "Hard, 3"
Multi-Select
A multi-selection dropdown allowing multiple choices.
Methods:
- Set(itemText, isSelected): Sets the selection state of an item
- Get(): Returns a table of selected items
- SetItems(newItems, idx): Updates the multiselect items
- SetText(newText): Sets the dropdown text to 'newText'
- SetCallback(newCallback): Sets the callback function to 'newCallback'
- Destroy(): Removes the multi-select from the UI
Example:
local multiselect = tab:CreateMultiSelect({text = "Features", items = {"Auto", "ESP", "Speed"}, default = {"ESP"}, callback = function(item, selected, allSelected)
print(item, "is now", selected and "selected" or "deselected")
print("All selected:", allSelected)
end})
local selected = multiselect:Get() -- Table of selected items
Title and Text
Display elements for showing information.
Methods:
- SetText(newText): Updates the displayed text
- Destroy(): Removes the element from the UI
Example:
local title = tab:CreateTitle({text = "Settings Panel"})
local text = tab:CreateText({text = "Adjust your preferences below."})
title:SetText("Advanced Settings") -- Update title
Notifications
The notification system displays temporary messages to the user.
window:SendNotification({text = "This is a notification!", duration = 5})
Notifications appear in the bottom-right corner.
Examples
Basic Window with Button
local EnhancedUI = loadstring(game:HttpGet("https://renhanced.deitsuki.games/uilib"))()
local window = EnhancedUI.Window.new({title = "My Script"})
local mainTab = window:CreateTab({name = "Main"})
local clickCount = 0
local button = mainTab:CreateButton({text = "Click Me", callback = function()
clickCount = clickCount + 1
button:SetText("Clicked " .. clickCount .. " times")
end})
Toggle and Input
local toggle = mainTab:CreateToggle({text = "Enable Feature", callback = function(state)
print("Feature enabled:", state)
end, default = false})
local input = mainTab:CreateInput({text = "Enter name", callback = function(text)
print("Name entered:", text)
end, default = "Default Name"})
Dropdown Selection
local options = {"Option 1", "Option 2", "Option 3"}
local dropdown = mainTab:CreateDropdown({text = "Choose Option", items = options, default = 1, callback = function(selected, index)
print("Selected:", selected, "Index:", index)
end})
Multi-Select
local items = {"Item A", "Item B", "Item C"}
local multiselect = mainTab:CreateMultiSelect({text = "Select Items", items = items, callback = function(item, selected, allSelected)
print(item, "is now", selected and "selected" or "deselected")
end})
Notification
window:SendNotification({text = "Script loaded successfully!"})