Advertisement
ReplyIsHere

VesperaGUI

Jan 21st, 2025 (edited)
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.79 KB | None | 0 0
  1. -- Required Services
  2. local TweenService = game:GetService("TweenService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local RunService = game:GetService("RunService")
  5. local Workspace = game:GetService("Workspace")
  6. local Players = game:GetService("Players")
  7. local LocalPlayer = Players.LocalPlayer
  8. local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
  9. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  10.  
  11. -- Mobile Optimization Setup
  12. local screenWidth = Workspace.CurrentCamera.ViewportSize.X
  13. local OptimizeForMobile = screenWidth < 800  -- Detect mobile screen width
  14.  
  15. -- Core Setup for VesperaGUI (starting with Rayfield-like system)
  16. local VesperaGUI = {}
  17. VesperaGUI.__index = VesperaGUI
  18.  
  19. -- Function to Create a Window
  20. function VesperaGUI:CreateWindow(WindowDetails)
  21.     local Window = Instance.new("ScreenGui")
  22.     Window.Name = WindowDetails.Name
  23.     Window.Parent = PlayerGui
  24.  
  25.     -- Window Setup
  26.     local MainFrame = Instance.new("Frame")
  27.     MainFrame.Size = UDim2.new(0.8, 0, 0.8, 0)
  28.     MainFrame.Position = UDim2.new(0.1, 0, 0.1, 0)
  29.     MainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  30.     MainFrame.Parent = Window
  31.  
  32.     -- Window Header
  33.     local Header = Instance.new("TextLabel")
  34.     Header.Text = WindowDetails.LoadingTitle
  35.     Header.Size = UDim2.new(1, 0, 0.1, 0)
  36.     Header.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  37.     Header.TextColor3 = Color3.fromRGB(255, 255, 255)
  38.     Header.Font = Enum.Font.GothamBold
  39.     Header.TextSize = 24
  40.     Header.Parent = MainFrame
  41.  
  42.     -- Loading Subtitle
  43.     local Subtitle = Instance.new("TextLabel")
  44.     Subtitle.Text = WindowDetails.LoadingSubtitle
  45.     Subtitle.Size = UDim2.new(1, 0, 0.1, 0)
  46.     Subtitle.Position = UDim2.new(0, 0, 0.1, 0)
  47.     Subtitle.BackgroundTransparency = 1
  48.     Subtitle.TextColor3 = Color3.fromRGB(150, 150, 150)
  49.     Subtitle.Font = Enum.Font.Gotham
  50.     Subtitle.TextSize = 16
  51.     Subtitle.Parent = MainFrame
  52.  
  53.     return Window
  54. end
  55.  
  56. -- Function to Create Tabs
  57. function VesperaGUI:CreateTab(TabName, IconId)
  58.     local Tab = Instance.new("Frame")
  59.     Tab.Name = TabName
  60.     Tab.Size = UDim2.new(1, 0, 1, 0)
  61.     Tab.BackgroundTransparency = 1
  62.     Tab.Parent = PlayerGui
  63.  
  64.     local TabLabel = Instance.new("TextLabel")
  65.     TabLabel.Text = TabName
  66.     TabLabel.Size = UDim2.new(1, 0, 0.1, 0)
  67.     TabLabel.BackgroundTransparency = 1
  68.     TabLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  69.     TabLabel.Font = Enum.Font.Gotham
  70.     TabLabel.TextSize = 18
  71.     TabLabel.Parent = Tab
  72.  
  73.     return Tab
  74. end
  75.  
  76. -- Function to Create Button
  77. function VesperaGUI:CreateButton(ButtonName, ParentTab, Callback)
  78.     local Button = Instance.new("TextButton")
  79.     Button.Text = ButtonName
  80.     Button.Size = UDim2.new(0.8, 0, 0.1, 0)
  81.     Button.Position = UDim2.new(0.1, 0, 0.2, 0)
  82.     Button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  83.     Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  84.     Button.Font = Enum.Font.Gotham
  85.     Button.TextSize = 18
  86.     Button.Parent = ParentTab
  87.  
  88.     Button.MouseButton1Click:Connect(Callback)
  89.     return Button
  90. end
  91.  
  92. -- Function to Create Slider
  93. function VesperaGUI:CreateSlider(SliderName, MinValue, MaxValue, ParentTab, Callback)
  94.     local Slider = Instance.new("Frame")
  95.     Slider.Size = UDim2.new(0.8, 0, 0.1, 0)
  96.     Slider.Position = UDim2.new(0.1, 0, 0.2, 0)
  97.     Slider.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  98.     Slider.Parent = ParentTab
  99.  
  100.     local SliderBar = Instance.new("TextButton")
  101.     SliderBar.Size = UDim2.new(1, 0, 0.2, 0)
  102.     SliderBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  103.     SliderBar.TextTransparency = 1
  104.     SliderBar.Parent = Slider
  105.  
  106.     -- Add Slider Functionality
  107.     local SliderValue = MinValue
  108.     SliderBar.MouseMoved:Connect(function(_, y)
  109.         local pos = math.clamp(y / Slider.AbsoluteSize.Y, 0, 1)
  110.         SliderValue = math.floor(MinValue + (MaxValue - MinValue) * pos)
  111.         Callback(SliderValue)
  112.     end)
  113.  
  114.     return Slider
  115. end
  116.  
  117. -- Function to Send Notifications
  118. function VesperaGUI:SendNotification(Title, Content)
  119.     local Notification = Instance.new("Frame")
  120.     Notification.Size = UDim2.new(0.8, 0, 0.1, 0)
  121.     Notification.Position = UDim2.new(0.1, 0, 0.7, 0)
  122.     Notification.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  123.     Notification.Parent = PlayerGui
  124.  
  125.     local NotificationText = Instance.new("TextLabel")
  126.     NotificationText.Text = Title .. ": " .. Content
  127.     NotificationText.Size = UDim2.new(1, 0, 1, 0)
  128.     NotificationText.TextColor3 = Color3.fromRGB(255, 255, 255)
  129.     NotificationText.Font = Enum.Font.Gotham
  130.     NotificationText.TextSize = 14
  131.     NotificationText.Parent = Notification
  132.  
  133.     -- Tween for notification pop-in effect
  134.     local Tween = TweenService:Create(Notification, TweenInfo.new(0.5), {Position = UDim2.new(0.1, 0, 0.6, 0)})
  135.     Tween:Play()
  136. end
  137.  
  138. -- Setup VesperaGUI
  139. local Vespera = setmetatable({}, VesperaGUI)
  140.  
  141. -- Example: Creating a Window with a Tab and Button
  142. local MyWindow = Vespera:CreateWindow({
  143.     Name = "VesperaGUI Example Window",
  144.     LoadingTitle = "VesperaGUI Interface Suite",
  145.     LoadingSubtitle = "by Your Name"
  146. })
  147.  
  148. local MyTab = Vespera:CreateTab("Main Tab", "rewind")  -- You can replace "rewind" with any icon
  149.  
  150. -- Add Button
  151. Vespera:CreateButton("Test Button", MyTab, function()
  152.     print("Button Clicked!")
  153. end)
  154.  
  155. -- Add Slider
  156. Vespera:CreateSlider("Volume Slider", 0, 100, MyTab, function(value)
  157.     print("Slider Value: " .. value)
  158. end)
  159.  
  160. -- Check if the screen is mobile
  161. if OptimizeForMobile then
  162.     -- Mobile Adjustments: Bigger UI elements
  163.     MyWindow.Size = UDim2.new(1, 0, 1, 0)
  164.     MyTab.Size = UDim2.new(1, 0, 1, 0)
  165. end
  166.  
  167. -- Example Usage of Notification
  168. Vespera:SendNotification("VesperaGUI", "This is a test notification.")
  169.  
  170. -- Return VesperaGUI to allow access to the library
  171. return VesperaGUI
  172.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement