A gradient background instantly elevates your main menu from plain to professional. UIGradient lets you blend two colors smoothly, creating depth without heavy images. Combined with clean button design and simple scripts, you can build a polished menu that feels like a real game.
This guide walks you through building a complete main menu from scratch—positioning frames, applying gradients, and writing the scripts that make buttons work.
Why UIGradient for Main Menus
UIGradient is a descendant you add to any GuiObject (Frame, TextButton, ImageLabel, etc.) to apply a smooth color transition. It's lightweight, scales perfectly to any screen size, and requires no external images. For menus, that means:
- No image file overhead—colors are generated in-engine
- Instant color changes via scripts if you want dynamic themes
- Works on frames, buttons, text, and backgrounds
- Combines beautifully with transparency effects
A gradient background immediately signals polish and care, making players more invested before they even click Play.
Setting Up Your Menu Frame
Start by creating the container for your menu in the Explorer. You'll work inside StarterGui so the menu appears when the game loads.
- In the Explorer, right-click StarterGui and insert a ScreenGui. Name it MainMenu.
- Set its ResetOnSpawn to false (so it persists during gameplay).
- Right-click MainMenu and insert a Frame. Name it MenuBackground.
- Set the Frame's size to
{1, 0}, {1, 0}(full screen) and position to{0, 0}, {0, 0}(top-left corner). - Set BackgroundColor3 to a base color—something neutral like Color3.fromRGB(20, 20, 30) (dark blue-black).
- Leave BackgroundTransparency at 0 for now; the gradient will layer on top.
Now you have a full-screen container. This is where the gradient goes.
Adding the UIGradient Component
Right-click MenuBackground and insert a UIGradient. This is the star of the show.
Open the Properties panel and adjust these key settings:
- Color: Click the small color box. Add two stops to create the blend. Set the left stop to a dark color (like
Color3.fromRGB(20, 20, 50)) and the right stop to a brighter accent (likeColor3.fromRGB(100, 150, 200)—a light blue). - Rotation: Use 45 to create a diagonal gradient, or 90 for vertical, or 0 for horizontal. Experiment to match your aesthetic.
- Transparency: Set to 0 for a solid gradient. You can use a slight curve (like slight transparency on one end) for drama, but for menus, flat is usually cleaner.
You should see the gradient fill your MenuBackground frame immediately. If it looks too harsh, adjust your color stops to be closer together, or reduce the saturation of the brighter color.
Creating Gradient Buttons
Now add buttons to your menu. Each button can have its own subtle gradient to stand out from the background.
- Right-click MenuBackground and insert a TextButton. Name it PlayButton.
- Set its size to around
{0, 150}, {0, 50}and position it in the center—try{0.5, -75}, {0.5, -25}. - Set BackgroundColor3 to a contrasting color, like
Color3.fromRGB(50, 200, 100)(green). - Set TextSize to 24 and Text to "Play".
Now add a subtle gradient to the button itself:
- Right-click PlayButton and insert a UIGradient.
- Set its Color to blend from your button color to a slightly darker shade of the same color. For example, left stop:
Color3.fromRGB(50, 200, 100), right stop:Color3.fromRGB(30, 150, 70). - Set Rotation to 90 (vertical gradient) so it shades from top to bottom—this mimics depth and looks polished.
Duplicate this button (Ctrl+D or Cmd+D) twice to create "Settings" and "Quit" buttons, then reposition them vertically below the Play button. Update each button's text and colors.
Scripting Menu Interactions
The menu looks great, but buttons need to do something. Right-click PlayButton and insert a LocalScript. This script runs on each player's client.
local button = script.Parent
local teleportService = game:GetService("TeleportService")
local placeId = 0000000 -- Replace with your actual game place ID
button.MouseButton1Click:Connect(function()
print("Play button pressed")
-- Option 1: Teleport to another place
-- teleportService:Teleport(placeId, game.Players.LocalPlayer)
-- Option 2: Start the game in the same place (hide menu, spawn player)
local mainMenu = script.Parent.Parent.Parent
mainMenu.Enabled = false
print("Game started!")
end)