Advertisement
M0nkePr0

UI Lib made by openai

Dec 22nd, 2022
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. -- UI library
  2. local UI = {}
  3.  
  4. function UI.CreateButton(parent, text, position, size, callback)
  5. -- Create a button object
  6. local button = Instance.new("TextButton")
  7.  
  8. -- Set the button's properties
  9. button.Parent = parent
  10. button.Text = text
  11. button.Position = position
  12. button.Size = size
  13. button.Font = Enum.Font.SourceSans
  14. button.TextSize = 14
  15. button.TextColor3 = Color3.new(1, 1, 1)
  16. button.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  17.  
  18. -- Set the callback function for the button's "MouseButton1Click" event
  19. button.MouseButton1Click:Connect(callback)
  20.  
  21. -- Return the button object
  22. return button
  23. end
  24.  
  25. function UI.CreateLabel(parent, text, position, size, fontSize)
  26. -- Create a label object
  27. local label = Instance.new("TextLabel")
  28.  
  29. -- Set the label's properties
  30. label.Parent = parent
  31. label.Text = text
  32. label.Position = position
  33. label.Size = size
  34. label.Font = Enum.Font.SourceSans
  35. label.TextSize = fontSize or 14
  36. label.TextColor3 = Color3.new(1, 1, 1)
  37. label.BackgroundTransparency = 1
  38.  
  39. -- Return the label object
  40. return label
  41. end
  42.  
  43. function UI.CreateFrame(parent, position, size)
  44. -- Create a frame object
  45. local frame = Instance.new("Frame")
  46.  
  47. -- Set the frame's properties
  48. frame.Parent = parent
  49. frame.Position = position
  50. frame.Size = size
  51. frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  52.  
  53. -- Return the frame object
  54. return frame
  55. end
  56.  
  57. return UI
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement