К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot

godot-ui-control — скилл для Claude Code: что делает и как установить

Скилл для Claude Code учит агента верстать HUD и меню в Godot 4.7 на Control-нодах: якоря, контейнеры, тема, фокус.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-ui-control -a claude-code
Открыть на GitHub

Что делает godot-ui-control

Скилл задаёт агенту порядок вёрстки интерфейса в Godot 4.7: ноды Control вместо Node2D, якоря долями родительского прямоугольника, контейнеры (VBoxContainer, HBoxContainer, GridContainer, MarginContainer) вместо ручных координат. Внутри — последовательность шагов, готовые куски GDScript и разбор частых ошибок.

Тема и фокус вынесены в отдельные разделы. Theme вешается на верхний Control, дети её наследуют, а add_theme_* остаётся для точечных правок вроде размера шрифта у заголовка. Про фокус сказано прямо: без grab_focus() на стартовой кнопке и focus_mode = FOCUS_ALL геймпад ничего не выберет. Ещё скилл объясняет, почему дочерняя нода контейнера не двигается: позицию ей назначает контейнер.

Ограничение стоит знать заранее. Приём со сдвигом, поворотом и масштабом дочерней ноды через offset_transform_enabled появился в 4.7, на более ранних 4.x его нет, поэтому версию движка лучше проверить до того, как агент начнёт править .tscn. За анимациями UI скилл отправляет в godot-animation, за переназначением клавиш в input-systems. Математика якорей и все типы контейнеров расписаны в references/layout-and-theming.md.

Какие задачи решает

  • разложить HUD по якорям, чтобы он не разъезжался при ресайзе окна
  • собрать меню на VBoxContainer и повесить обработчики на pressed
  • вынести шрифты и цвета в Theme, а не править каждую кнопку по отдельности
  • настроить фокус, чтобы геймпад ходил по кнопкам меню
  • найти причину, по которой панель не масштабируется из-за нулевых якорей

Примеры запросов агенту

  • Перепиши `res://ui/hud.tscn`: панель должна растягиваться на весь родитель через `PRESET_FULL_RECT`, а кнопки стоять в `VBoxContainer`.
  • Кнопки в `menu.tscn` не реагируют на геймпад. Проверь `focus_mode` и добавь `grab_focus()` на первую из них.
  • Убери вызовы `add_theme_*` и сделай один `Theme` на корневом `Control`, чтобы стили наследовались.

Как установить godot-ui-control

1Через Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-ui-control -a claude-code

2Вручную: положить файлы

~/.claude/skills/godot-ui-control/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/godot-ui-control/

Из того же набора40

Весь набор →
game-feel gamedev-skills Скилл учит агента добавлять отклик к игровым действиям: тряску камеры, стоп-кадр, твины с easing, сквош и отброс. Для случаев, когда механика работает, но ощущается ватной. Claude Code CX Codex Cursor +1 9 400установок game-ui-ux gamedev-skills Архитектурный скилл для создания адаптивных игровых интерфейсов, стека экранов и навигации с геймпада без покадрового опроса состояния. Claude Code CX Codex Cursor +1 9 200установок level-design gamedev-skills Помогает спроектировать игровой уровень от блокута до плейтеста: маршруты, темп, препятствия и столкновения. Нужен при работе с whitebox, критическим путём и геймплейными комнатами. Claude Code CX Codex Cursor +1 7 500установок camera-systems gamedev-skills Рецепты для игровых камер в 2D и 3D: плавное следование, мёртвые зоны, опережение движения и обработка столкновений для Godot и Unity. Claude Code CX Codex Cursor +1 7 100установок audio-design gamedev-skills Скилл учит раскладывать игровой звук по шинам, глушить музыку под голос и собирать адаптивный саундтрек слоями. Примеры кода — на GDScript под Godot 4.7, с пометками для Unity. Claude Code CX Codex Cursor +1 7 100установок performance-optimization gamedev-skills Скилл учит искать узкое место в игре по профайлеру движка, а не по догадке, и даёт набор правок: пулы объектов, батчинг, отказ от лишних аллокаций. Claude Code CX Codex Cursor +1 7 100установок game-ai gamedev-skills Помогает проектировать логику врагов и NPC: конечные автоматы, деревья поведения, алгоритмы руления и поиск пути A*. Пригодится при сборке поведения ботов для любого движка. Claude Code CX Codex Cursor +1 7 100установок input-systems gamedev-skills Архитектура игровых управлений: отображение клавиш на действия, перекоординирование с проверкой конфликтов, поддержка клавиатуры, геймпада и сенсора, мёртвые зоны, буферизация и coyote time. Claude Code CX Codex Cursor +1 6 800установок

Похожие

asset-pipeline rehan-remade Готовит из сгенерированной или нарисованной картинки файлы, которые загрузит движок: кадры спрайтов, полосы анимации, изометрические ракурсы из 3D-модели. Claude Code CX Codex Cursor +1 1 500установок mashup-mods rehan-remade Скилл для создания кросс-игровых модов: от Minecraft внутри Skyrim до скейтбординга в MW2. Охватывает passthrough-моды, портирование контента и встраивание одной игры в другую. Claude Code CX Codex Cursor +1 1 500установок game-automation rehan-remade Скилл запускает игры, снимает экран через GPU-захват и управляет окном через виртуальные клавиши и мышь. Нужен ИИ-агенту для автоматической проверки модов в реальной игре. Claude Code CX Codex Cursor +1 1 500установок orbit-card heygen-com Скилл для встраивания готового 10-секундного 3D-блока HyperFrames: карточка фичи облетает сферу из точек по траектории камеры из Blender. Claude Code CX Codex Cursor +1 9 800установок sdf earthtojake Скилл создаёт и проверяет SDFormat-файлы для моделей и миров, а затем помогает подготовить их к передаче в симулятор. Claude Code CX Codex Cursor +1 10 500установок urdf earthtojake Скилл помогает создавать, проверять и отлаживать описания роботов в формате URDF. Пригодится для работы со звеньями, сочленениями и геометрией. Claude Code CX Codex Cursor +1 10 400установок hatch-pet официальный openai Создаёт и упаковывает анимированных питомцев и спрайт-листы для Codex. Пригодится, когда нужен персонаж по описанию, изображению или фирменным ориентирам. Claude Code CX Codex Cursor +1 3 300установок gcode earthtojake Нарезает модели STL, 3MF и OBJ в G-code через OrcaSlicer. Подходит, когда нужно подготовить файл для печати без подключения к принтеру. Claude Code CX Codex Cursor +1 9 500установок

Вопросы о godot-ui-control

Как установить godot-ui-control в Claude Code?

Выполнить npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-ui-control -a claude-code. Файл скилла появится по пути ~/.claude/skills/godot-ui-control/SKILL.md.

Что делает godot-ui-control?

Показывает агенту, как собирать интерфейсы Godot 4.7 на нодах Control: якоря и offsets, контейнеры, ресурс Theme и навигация фокусом с клавиатуры и геймпада.

Подойдёт ли скилл для Godot 3?

Он написан под 4.x: в примерах size, position и custom_minimum_size, тогда как в Godot 3 это rect_size, rect_position и rect_min_size. Код из скилла придётся переписывать.

Исходный текст

SKILL.md · Apache-2.0
---
name: godot-ui-control
description: >
  Build Godot 4.7 user interfaces with Control nodes: anchors and offsets for
  responsive layout, Container nodes (VBox/HBox/Grid/Margin) for automatic
  arrangement, Theme resources for consistent styling, and keyboard/gamepad focus
  navigation. Use when laying out a HUD, menu, or UI in a Godot project, working
  with Control/Container nodes, anchors, themes, or focus in a .tscn.
---

# Godot UI / Control nodes (4.x)

Lay out responsive UI with `Control` anchors and `Container` nodes, style it with a
`Theme`, and make it navigable by keyboard and gamepad. Targets **Godot 4.7**.

## When to use

- Use when building HUDs, menus, inventories, dialog boxes, or settings screens with
  `Control`-derived nodes; arranging UI that adapts to window size; theming; or wiring
  focus navigation for controller/keyboard.

**When *not* to use:** in-world 2D nodes (`Node2D`/sprites) → `godot-nodes-scenes`;
animating UI transitions → `godot-animation` (Tween); genre UIs like card hands →
`card-game`/`visual-novel`. For full input rebinding → `input-systems`.

## Core workflow

1. **Use `Control` nodes for UI**, not `Node2D`. Controls have a rect (position + size),
   anchors, and participate in focus/theming.
2. **Anchor for responsiveness.** Anchors are fractions (0–1) of the parent rect that the
   Control's edges stick to. Use the editor's **Layout** presets (Top-Left, Full Rect,
   Center, etc.) instead of hand-placing pixels.
3. **Let Containers position children.** Put children in a `VBoxContainer`,
   `HBoxContainer`, `GridContainer`, `MarginContainer`, etc. — the container sets their
   position/size; you control flow with `size_flags`. Don't set child anchors inside a
   container (it overrides them).
4. **Style with a `Theme`.** Assign a `Theme` resource on a top Control; children inherit
   it. Override per-node with theme overrides only when necessary.
5. **Wire focus** so gamepad/keyboard can move between buttons; set a default focused
   control and define neighbors or rely on auto-neighbor.
6. **Connect signals** (`pressed`, `toggled`, `text_submitted`, `value_changed`).

## Patterns

### 1. Responsive layout with anchors (code form)

```gdscript
extends Control

func _ready() -> void:
    # Stretch this panel to fill its parent (the editor's "Full Rect" preset).
    # Setting only anchors (or `anchors_preset`) keeps the current offsets, so the
    # control keeps its old rect; this call moves anchors AND resets offsets.
    set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
    # Manual equivalent: anchor_left = 0; anchor_top = 0; anchor_right = 1;
    # anchor_bottom = 1, then set all four offset_* to 0.
```

### 2. A menu built from containers + button signals

```gdscript
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. Size flags: make one child expand to fill leftover space

```gdscript
# In a HBoxContainer: a label on the left, a spacer that eats remaining width.
func _ready() -> void:
    $Label.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
    $Spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL   # grows to fill
```

### 4. Theme override for one node (without a full Theme resource)

```gdscript
func _ready() -> void:
    # Per-node overrides: use add_theme_* (type-specific setters).
    $Title.add_theme_font_size_override("font_size", 32)
    $Title.add_theme_color_override("font_color", Color.GOLD)
    $Panel.add_theme_stylebox_override("panel", preload("res://ui/panel.stylebox.tres"))
```

## Pitfalls

- **Mixing manual position with Containers.** A child of a `Container` cannot set its own
  position/anchors — the container owns layout. To free-place, take the node out of the
  container or use a plain `Control`/`PanelContainer` wrapper. To nudge, rotate or scale a
  container child (e.g. a hover pop) in 4.7+, set `offset_transform_enabled = true` and use
  `offset_transform_position`/`_rotation`/`_scale`; the container leaves those alone.
- **Anchors vs offsets.** Anchors are fractions of the parent; offsets are pixel deltas
  from the anchored point. Set anchors via presets, then nudge with offsets. Setting only
  position while anchors are at 0 makes UI not scale with the window.
- **`Node2D` for UI.** Buttons/labels parented under a `Node2D` won't theme or take focus
  correctly. Keep UI under a `CanvasLayer`/`Control` subtree.
- **Focus lost on gamepad.** If nothing is focused, directional input does nothing. Call
  `grab_focus()` on an initial control and ensure `focus_mode` is `FOCUS_ALL` (`FOCUS_CLICK`
  is mouse-only, `FOCUS_NONE` never focuses).
- **Theme vs theme override.** A `Theme` resource styles a whole subtree; `add_theme_*`
  overrides one node. Overusing per-node overrides defeats centralized theming.
- **`rect_*` properties are renamed.** Godot 3's `rect_size`/`rect_position`/`rect_min_size`
  are now `size`/`position`/`custom_minimum_size` in 4.x.
- **`mouse_filter`** on a full-rect Control can swallow clicks meant for nodes beneath it;
  set `MOUSE_FILTER_IGNORE` on purely decorative panels.

## References

- For the anchor/offset math, every Container type, building/extending Theme and StyleBox
  resources, focus neighbor wiring, and `CanvasLayer` for HUDs, read
  `references/layout-and-theming.md`.

## Related skills

- `game-ui-ux` — cross-engine UI/UX: responsive scaling, safe areas, focus navigation, screen flow.
- `godot-animation` — Tween-based UI transitions and juicing.
- `godot-signals-groups` — connecting UI events to game logic.
- `input-systems` — rebindable input and multi-device focus.
- `card-game` / `visual-novel` — UI-heavy genre templates.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой