Loading...
Loading...
Responsive cross-platform UI - ScreenGui and safe areas (ScreenInsets), Scale vs Offset, UIListLayout flex/UIFlexItem, constraints, StyleSheets/tokens/themes, RichText, gamepad/touch navigation, UIDragDetector, CanvasGroup, tweens, BillboardGui/SurfaceGui, React-lua/Fusion/Vide. Use when building HUDs, menus, shops, inventories, or fixing UI that breaks on mobile, console, or other screen sizes.
npx skill4agent add el4cteo/roblox-skills roblox-uiStarterGuiScreenGuiPlayerGuiPlayerGuiScreenGuiResetOnSpawn = falseZIndexBehavior = SiblingIgnoreGuiInsetScreenInsets = CoreUISafeInsetsDeviceSafeInsetsNoneUDim2.fromScaleAnchorPoint = Vector2.new(0.5, 0.5)Position = UDim2.fromScale(0.5, 0.5)UIAspectRatioConstraintUISizeConstraintUITextSizeConstraintTextScaledTextSizeAutomaticSizeTextScaledAutomaticSize| Need | Use |
|---|---|
| Rows/columns that adapt | |
| One item grows to fill space | |
| Grids (inventory) | |
| Carousels/pages | |
| Rounded corners, borders, padding | |
| Gradients, shadows | |
| Scale a whole group | |
--!strict
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Hud"
screenGui.ResetOnSpawn = false
screenGui.ScreenInsets = Enum.ScreenInsets.CoreUISafeInsets
local bar = Instance.new("Frame")
bar.Name = "Toolbar"
bar.AnchorPoint = Vector2.new(0.5, 1)
bar.Position = UDim2.new(0.5, 0, 1, -16)
bar.Size = UDim2.fromScale(0.6, 0.1)
bar.BackgroundTransparency = 0.3
bar.Parent = screenGui
local list = Instance.new("UIListLayout")
list.FillDirection = Enum.FillDirection.Horizontal
list.HorizontalFlex = Enum.UIFlexAlignment.Fill -- slots share the width equally
list.Padding = UDim.new(0, 8)
list.Parent = bar
Instance.new("UICorner").Parent = bar
local padding = Instance.new("UIPadding")
padding.PaddingLeft, padding.PaddingRight = UDim.new(0, 8), UDim.new(0, 8)
padding.Parent = bar
for slot = 1, 5 do
local button = Instance.new("TextButton")
button.Name = `Slot{slot}`
button.Text = tostring(slot)
button.Size = UDim2.fromScale(0, 1)
button.Parent = bar
Instance.new("UIAspectRatioConstraint").Parent = button
end
screenGui.Parent = playerGui -- parent last: one layout pass, no flickerStyleSheetStyleRuleSelector"TextButton"".Primary""#Close""TextButton:Hover""::UICorner"rule:SetProperties({...})$Primary$RadiusStyleDeriveStyleDeriveStyleLinkScreenGui@NameUserInputService.PreferredInputKeyboardAndMouseTouchGamepadUserInputService:GetPropertyChangedSignal("PreferredInput")TouchEnabledKeyboardEnabledGuiButton.ActivatedMouseButton1ClickSelectableGuiService.SelectedObjectSelectionGroupNextSelection*ButtonBInputBinding.UIButtonroblox-inputRichText = true<b><i><font color="#FF0"><stroke>TextService:FilterStringAsyncroblox-text-chatFontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold)LocalizationTableTweenService:Create(frame, TweenInfo.new(0.2, Enum.EasingStyle.Quad), { Position = ... }):Play()UIScale.ScaleSizeCanvasGroupGroupTransparencyUIDragDetectorGuiObject.DraggableBillboardGuiMaxDistanceAlwaysOnTopSizeSurfaceGuiAdorneePlayerGuiProximityPromptjsdotlua/reactreact-robloxVisible = falseEnabled = falseUIGradientCanvasGroupUIStrokeroblox-inputroblox-text-chatroblox-monetizationroblox-luauroblox-performance