roblox-ui
它能做什么
该技能讲解如何在 Roblox 中构建清晰、灵敏的界面,例如 HUD、物品栏和商店。适合希望菜单在手机、主机和电脑上都能正常使用的开发者。
适用场景
- ✓当你在 Roblox Studio 中构建 HUD、物品栏、商店或设置界面时。
- ✓当你的界面在手机上或不同窗口尺寸下显示错误时。
- ✓当菜单需要支持 Roblox 中的手柄焦点或触屏控制时。
技能链接
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-ui/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Roblox 商店窗口在手机上被截断了,你能让它适配每种屏幕尺寸吗?”
每周 5 个新技能,1 分钟读完。
工作原理
该技能讲解如何设置屏幕界面、使用可缩放的布局、在角色重生时处理界面的生命周期,并在多种屏幕尺寸下检查结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Roblox UI
Implement deliberate, editable Roblox UI that preserves the experience's visual language and
works across supported devices. Targets Roblox's rolling platform APIs. Pair with game-ui-ux
for engine-neutral information architecture and UX; this skill owns Roblox Instances and APIs.
When to use
- Use for authored
ScreenGuiinterfaces, Roblox layout/constraint APIs, UI lifecycle, input, focus, animation, performance, or responsive/device fixes. - Use to replace brittle pixel layouts, runtime-created Instance tangles, mouse-only menus, or generic generated styling with a maintainable hierarchy.
When not to use: general UX flow and accessibility principles belong to game-ui-ux; raw
gameplay action mapping belongs to input-systems; server trust belongs to roblox-networking.
Workflow
- Inspect before designing. In Explorer, inventory existing
ScreenGuis, UI modules, fonts, colors, icon family, spacing, corners, strokes, animation timing, naming, and reusable components, including anyStyleSheet/StyleLinkstyling, tokens and themes. Capture representative screenshots at two viewports. Extend that language. - Define ownership and lifecycle.
StarterGuiis the authored template; Roblox clones it into each player'sPlayerGui. Decide whether eachScreenGuishould persist across respawn withResetOnSpawn = false; never keep stale references to a destroyed clone. - Author a readable hierarchy. Prefer meaningful editable Instances and small behavior modules. A normal screen should be understandable in Explorer; procedural generation is for genuinely data-driven repetition, not the whole shell.
- Build responsive structure. Combine
UDim2scale for placement with bounded offsets, correctAnchorPoints, layouts, padding, content sizing, and constraints. Choose explicit narrow/wide arrangements instead of shrinking a desktop panel until it technically fits. - Handle platform obstructions. Keep interactive UI in
CoreUISafeInsets(the recommendedScreenGui.ScreenInsetsdefault), and account for touch controls and TV distance/overscan. - Wire state and input. Render from a small view state; update on events. Use
ActivatedforGuiButtons, explicit selected states, and reachable gamepad navigation. Bind non-widget actions withContextActionServiceonly while the screen owns them. - Polish with restraint. Implement hover, pressed, selected, and disabled states. Animate
state changes, not decoration; honor
GuiService.ReducedMotionEnabledand clean up tweens and connections when the screen closes or is replaced. - Verify the real interface. Use Device Simulator and Controller Emulator. Test desktop, narrow portrait, mobile landscape, tablet-like, and console/gamepad; then respawn. Record clipping, overlap, text, scroll, safe-area, focus path, touch target, and lifecycle results.
Production structure
StarterGui
└── InventoryGui (ScreenGui; ResetOnSpawn = false)
├── Root (Frame)
│ ├── Header
│ ├── Content
│ │ ├── CategoryList
│ │ ├── ItemGrid (ScrollingFrame)
│ │ └── DetailsPanel
│ └── Footer
└── InventoryController (LocalScript)
ReplicatedStorage
└── UI
├── Components
└── Theme
Names describe roles, not colors or temporary positions. Keep repeated item cells as templates or components, but keep the authored shell visible in Explorer.
Patterns
Layout that survives content and viewport changes
-- Authored properties on ItemGrid (ScrollingFrame):
-- AutomaticCanvasSize = Enum.AutomaticSize.Y
-- CanvasSize = UDim2.fromOffset(0, 0)
-- Children: UIPadding + UIGridLayout
local grid = itemGrid.UIGridLayout
local projectBreakpoint = 700 -- derive from where this composition stops being usable
local function applyComposition()
local narrow = root.AbsoluteSize.X < projectBreakpoint
categoryList.UIListLayout.FillDirection = if narrow
then Enum.FillDirection.Horizontal
else Enum.FillDirection.Vertical
categoryList.Size = if narrow
then UDim2.new(1, 0, 0, 40)
else UDim2.new(0, 148, 1, 0)
itemGrid.Position = if narrow then UDim2.fromOffset(0, 52) else UDim2.fromOffset(164, 0)
itemGrid.Size = if narrow
then UDim2.new(1, 0, 1, -52)
else UDim2.new(0.58, -164, 1, 0)
detailsPanel.Visible = not narrow -- open details as a separate narrow-screen
常见问题
为什么我的界面在重生后会重置?
该技能说明,每个屏幕都有一个设置,用于控制玩家重新出生时它是否会被重置。
它涵盖一般的用户体验设计吗?
涵盖得不深入。一般的界面设计原则由另一份用户体验技能负责。
它涵盖游戏内输入吗?
只涵盖一部分。游戏输入映射由另一份输入技能负责。
详情
作者的原始描述
Build production Roblox interfaces with ScreenGui/PlayerGui lifecycle, responsive UDim2 layouts, safe insets, reusable editable Instances, cross-device input and selection, restrained motion, cleanup, and multi-viewport verification. Use for Roblox HUDs, inventories, shops, settings, ability bars, ScrollingFrames, AutomaticSize, GuiService, gamepad focus, touch UI, or UI that clips, resets on respawn, looks generic, or was generated as one giant LocalScript.
热度
- GitHub 星标
- 6.6k
- 排名
- #13843
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/28
评论
- …