godot-ui-control
БесплатноБез исполняемых скриптовНе проверенGodot 4.7 Control-node API for menus and HUDs: anchors, Containers, Theme and StyleBox, focus neighbours and stretch settings, with a headless layout check…
от gamedev-skills★ 12 656 звёзд на GitHubОб этом скилле
Godot UI / Control nodes (4.x)
Lay out responsive UI with Control anchors and Container nodes, style it with a
Theme, make it navigable by keyboard and gamepad, and prove the layout holds at more
than one screen size. Targets Godot 4.7 (see Version notes). Design rules (what a good
HUD or menu needs) live in game-ui-ux; load both for engine UI work.
When to use
- HUDs, menus, inventories, dialog boxes or settings screens built from
Controlnodes; UI that must adapt to window size; theming; focus navigation for controller/keyboard.
When not to use: in-world Node2D/sprites → godot-nodes-scenes; UI tweens →
godot-animation; rebinding → input-systems; card hands and VN text boxes →
card-game / visual-novel.
Core workflow
Read the stretch settings first.
project.godot[display]holdswindow/size/viewport_width/viewport_height(base size, default 1152x648),window/stretch/mode(canvas_itemsis the usual choice for UI-heavy games) andwindow/stretch/aspect(expandlets UI use extra width or height). Layout bugs on other screens usually start here.Use
Controlnodes for UI, notNode2D, and put HUDs under aCanvasLayerso the game camera does not move them.Anchor top-level panels; let Containers place their children. Outside containers, set anchors with presets (
set_anchors_and_offsets_preset()). Inside aVBoxContainer,HBoxContainer,GridContainerorMarginContainer, the container owns position and size; steer it withsize_flags_*. In a.tscn, a Full Rect panel reads:[node name="PauseMenu" type="Control"] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2Keep whatever
layout_modeline Godot wrote; it records whether anchors or a parent container drive the node.Style with one
Theme. Set a project-wide theme withgui/theme/custom="res://ui/theme.tres"inproject.godot, or assignthemeon the top Control; children inherit it. Use per-nodeadd_theme_*_overrideonly for exceptions.Wire focus. Give the first button focus when a menu opens (
grab_focus()), keepfocus_mode = FOCUS_ALLon anything a gamepad must reach, and setfocus_neighbor_*only where the automatic geometry guess is wrong.Connect signals (
pressed,toggled,text_submitted,value_changed).Check before you finish.
- Run the layout test (Pattern 4) headless:
godot --headless --path . --script res://tests/test_ui_layout.gdand read the exit code. It flags controls pushed off-screen and menus with nothing focused, at each size. - Run the
godot-nodes-scenesskill'sscripts/check_godot_project.py <project-dir>if you edited.tscn/.tresfiles (themes, StyleBoxes, fonts). - For a picture, on a machine with a GPU (not
--headless), capture frames and look at them:godot --path . --resolution 2560x1080 --write-movie $OUT/menu.png --quit-after 3 --scene res://ui/main_menu.tscnwrites numbered PNGs next to that path. Repeat at 1280x720. - With no Godot binary (
godot,godot4or$GODOT_BIN), ask the user to run these and paste the output or screenshots. Ask the user to try the menu with a gamepad and report any button that cannot be reached.
- Run the layout test (Pattern 4) headless:
Patterns
1. Full Rect from code (anchors and offsets)
extends Control
func _ready() -> void:
# Setting only anchors (or `anchors_preset`) keeps the old offsets, so the rect
# would not snap to the preset. This moves anchors AND resets offsets.
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
2. A menu from containers, with initial focus
extends VBoxContainer # children stack vertically, auto-sized
func _ready() -> void:
for child in get_children():
if child is Button:
child.pressed.connect(_on_button_pressed.bind(child.name))
# Give the first button focus so a gamepad can navigate immediately.
if get_child_count() > 0:
(get_child(0) as Control).grab_focus()
func _on_button_pressed(which: StringName) -> void:
match which:
"PlayButton": get_tree().change_scene_to_file("res://game.tscn")
"QuitButton": get_tree().quit()
3. One child takes the leftover space
func _ready() -> void:
$Label.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
$Spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL # grows to fill
4. Headless layout test at several sizes
# res://tests/test_ui_layout.gd
extends SceneTree
# The sizes the UI really gets. With stretch mode canvas_items and aspect "expand",
# a 2560x1080 window on a 1152x648 base gives the UI 1536x648, not 2560x1080.
const SIZES: Array[Vector2i] = [Vector2i(1152, 648), Vector2i(1536, 648), Vector2i(1152, 864)]
func _initialize() -> void:
var failed := 0
f
Установить godot-ui-control в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл godot-ui-control?
Godot 4.7 Control-node API for menus and HUDs: anchors, Containers, Theme and StyleBox, focus neighbours and stretch settings, with a headless layout check. Use when Godot UI overlaps or drifts on resize, buttons ignore the gamepad, or an invisible panel swallows clicks. Not for engine-neutral UI rules (`game-ui-ux`; load both) or rebinding (`input-systems`).
Как установить скилл godot-ui-control?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл godot-ui-control запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic