Advertisement
MrStealUGurl

daliLibUI

Jan 8th, 2020
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. local dali = {}
  2. dali.gs = {}
  3.  
  4. dali.theme = { -- light
  5. main_container = Color3.fromRGB(249, 249, 255),
  6. separator_color = Color3.fromRGB(223, 219, 228),
  7.  
  8. text_color = Color3.fromRGB(96, 96, 96),
  9.  
  10. category_button_background = Color3.fromRGB(223, 219, 228),
  11. category_button_border = Color3.fromRGB(200, 196, 204),
  12.  
  13. checkbox_checked = Color3.fromRGB(114, 214, 112),
  14. checkbox_outer = Color3.fromRGB(198, 189, 202),
  15. checkbox_inner = Color3.fromRGB(249, 239, 255),
  16.  
  17. slider_color = Color3.fromRGB(114, 214, 112),
  18. slider_color_sliding = Color3.fromRGB(114, 214, 112),
  19. slider_background = Color3.fromRGB(198, 188, 202),
  20. slider_text = Color3.fromRGB(112, 112, 112),
  21.  
  22. textbox_background = Color3.fromRGB(198, 189, 202),
  23. textbox_background_hover = Color3.fromRGB(215, 206, 227),
  24. textbox_text = Color3.fromRGB(112, 112, 112),
  25. textbox_text_hover = Color3.fromRGB(50, 50, 50),
  26. textbox_placeholder = Color3.fromRGB(178, 178, 178),
  27.  
  28. dropdown_background = Color3.fromRGB(198, 189, 202),
  29. dropdown_text = Color3.fromRGB(112, 112, 112),
  30. dropdown_text_hover = Color3.fromRGB(50, 50, 50),
  31. dropdown_scrollbar_color = Color3.fromRGB(198, 189, 202),
  32.  
  33. button_background = Color3.fromRGB(198, 189, 202),
  34. button_background_hover = Color3.fromRGB(215, 206, 227),
  35. button_background_down = Color3.fromRGB(178, 169, 182),
  36. }
  37.  
  38. setmetatable(dali.gs, {
  39. __index = function(_, service)
  40. return game:GetService(service)
  41. end,
  42. __newindex = function(t, i)
  43. t[i] = nil
  44. return
  45. end
  46. })
  47.  
  48. local mouse = dali.gs["Players"].LocalPlayer:GetMouse()
  49.  
  50. function dali:Create(class, properties)
  51. local object = Instance.new(class)
  52.  
  53. for prop, val in next, properties do
  54. if object[prop] and prop ~= "Parent" then
  55. object[prop] = val
  56. end
  57. end
  58.  
  59. return object
  60. end
  61.  
  62. function dali.new()
  63. local daliObject = {}
  64. local instance = daliObject
  65. local self = dali
  66. local tweenservice = game:GetService("TweenService")
  67. local frame = instance.container
  68.  
  69. frame.AnchorPoint = Vector2.new(0.5, 0.5)
  70. frame.Position = UDim2.new(0, 70, 0, 70)
  71. frame.BorderSizePixel = 0
  72. frame.Size = UDim2.new(0, 100, 0, 100)
  73. frame.BackgroundColor3 = Color3.fromRGB(26, 26, 26)
  74.  
  75. local tweeninfo1 = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  76. local tween1 = tweenservice:Create(frame, tweeninfo1, {Position = UDim2.new(0.5, 0, 0.5, 0)})
  77. local tweeninfo2 = TweenInfo.new(1.5, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
  78. local tween2 = tweenservice:Create(frame, tweeninfo2, {Rotation = 180})
  79.  
  80. tween1.Completed:Connect(function()
  81. tween2:Play()
  82. end)
  83.  
  84. wait(2)
  85.  
  86. tween1:Play()
  87.  
  88. wait(2.5)
  89.  
  90. frame:TweenSize(UDim2.new(0, 731,0, 379), "Out", "Sine", 0.3, true)
  91.  
  92. if not dali.gs["RunService"]:IsStudio() and self.gs["CoreGui"]:FindFirstChild("daliUI") then
  93. warn("dali:", "screengui already exist in coregui!")
  94.  
  95. return
  96. end
  97.  
  98. local toggled = true
  99. local typing = false
  100. local firstcat = false
  101.  
  102. local daliData
  103. daliData = {
  104. UpConnection = nil,
  105. ToggleKey = Enum.KeyCode.Home,
  106. }
  107.  
  108. instance.ChangeToggleKey = function(NewKey)
  109. daliData.ToggleKey = NewKey
  110. instance.tip.Text = "Press '".. string.sub(tostring(NewKey), 14) .."' to close the GUI."
  111.  
  112. if daliData.UpConnection then
  113. daliData.UpConnection:Disconnect()
  114. end
  115.  
  116. daliData.UpConnection = dali.gs["UserInputService"].InputEnded:Connect(function(Input)
  117. if Input.KeyCode == daliData.ToggleKey and not typing then
  118. toggled = not toggled
  119.  
  120. if toggled then
  121. instance.container:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 0.1, true)
  122. else
  123. instance.container:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), "Out", "Quad", 0.1, true)
  124. end
  125. end
  126. end)
  127. end
  128.  
  129. instance.userinterface = self:Create("ScreenGui", {
  130. Name = "uiLib",
  131. ZIndexBehavior = Enum.ZIndexBehavior.Global,
  132. ResetOnSpawn = false,
  133. })
  134.  
  135.  
  136.  
  137. instance.container = self:Create("Frame", {
  138. Draggable = true,
  139. Active = true,
  140. Name = "mainFrame",
  141. AnchorPoint = Vector2.new(0.5, 0.5),
  142. BackgroundTransparency = 0,
  143. BackgroundColor3 = Color3.fromRGB(26, 26, 26),
  144. BorderSizePixel = 1,
  145. Position = UDim2.new(0.5, 0, 0.5, 0),
  146. Size = UDim2.new(0, 731,0, 379),
  147. ZIndex = 2
  148. })
  149.  
  150. instance.menubutton = self:Create("TextButton", {
  151. Name = "MenuButton",
  152. BackgroundColor3 = Color3.fromRGB(26, 26, 26),
  153. BackgroundTransparency = 0,
  154. BorderColor3 = Color3.new(67, 67, 67),
  155. BorderSizePixel = 0,
  156. AutoButtonColor = false,
  157. ZIndex = 2,
  158.  
  159. })
  160.  
  161. instance.menu = self:Create("Frame", {
  162. Name = "Menu",
  163. BackgroundColor3 = Color3.fromRGB(27, 27, 27),
  164. BackgroundTransparency = 0,
  165. BorderColor3 = Color3.new(67, 67, 67),
  166. BorderSizePixel = 0,
  167. Size = UDim2.new(0, 120, 1, -30),
  168. Position = UDim2.new(0, 0, 0, 30),
  169. ZIndex = 2,
  170. })
  171.  
  172. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement