Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

godot-ui-control — Claude Code skill: what it does, how to install

A Claude Code skill that teaches the agent to lay out Godot 4.7 HUDs and menus with Control nodes: anchors, containers, themes and focus.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-ui-control -a claude-code
Open on GitHub

What godot-ui-control does

The skill gives the agent a fixed order of work for Godot 4.7 interfaces: use Control nodes instead of Node2D, set anchors as fractions of the parent rect, and let containers such as VBoxContainer or GridContainer place children rather than typing coordinates by hand. The steps come with GDScript snippets meant to be dropped into a scene.

Styling and focus get their own sections. A Theme resource goes on a top-level Control and children inherit it, while add_theme_* overrides stay for one-off changes like a bigger font on a title. Focus is spelled out: with no grab_focus() on the first button and focus_mode left away from FOCUS_ALL, a gamepad has nothing to select. The skill also explains why a child of a container ignores its own position.

One limit matters before you install. Nudging, rotating or scaling a container child through offset_transform_enabled works from 4.7, so on earlier 4.x builds an edit based on it will not hold, and the engine version is worth checking before the agent touches a .tscn. Animation work is pointed to godot-animation, key rebinding to input-systems. The anchor maths and every container type sit in references/layout-and-theming.md.

What it helps with

  • anchor a HUD so it holds together when the window resizes
  • build a menu from VBoxContainer and wire pressed handlers
  • move fonts and colours into a Theme instead of per-button overrides
  • get gamepad focus moving between menu buttons
  • trace why a panel ignores its anchors and never scales

Example prompts for the agent

  • Rewrite `res://ui/hud.tscn` so the panel stretches across its parent with `PRESET_FULL_RECT` and the buttons sit in a `VBoxContainer`.
  • The buttons in `menu.tscn` don't respond to my controller. Check `focus_mode` and add `grab_focus()` on the first one.
  • Replace the `add_theme_*` calls with a single `Theme` on the root `Control` so styles are inherited.

How to install godot-ui-control

1Skills CLI (Vercel)

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

2Manually: put the files in place

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

Copy the whole skill folder; for one project use .claude/skills/godot-ui-control/

From the same set40

The whole set →
game-feel gamedev-skills Teaches the agent to add feedback to game actions: camera shake, hit-stop, eased tweens, squash and stretch, knockback. For mechanics that work but feel weightless. Claude Code CX Codex Cursor +1 9,400installs game-ui-ux gamedev-skills Engine-neutral game UI architecture skill for responsive layouts, screen stacks, gamepad focus, and event-driven HUD updates. Claude Code CX Codex Cursor +1 9,200installs level-design gamedev-skills Plans playable game levels from blockout through playtesting, covering routes, pacing, gates and encounters. Use it when working on whiteboxes, critical paths or room flow. Claude Code CX Codex Cursor +1 7,500installs camera-systems gamedev-skills Engine-neutral patterns for 2D and 3D game cameras: smooth follow, deadzones, look-ahead, bounds clamping, and third-person collision. Claude Code CX Codex Cursor +1 7,100installs audio-design gamedev-skills A skill that treats game audio as a mixer graph: buses, gain in decibels, sidechain ducking, adaptive music and beat-synced events. Samples use Godot 4.7, Unity gets notes. Claude Code CX Codex Cursor +1 7,100installs performance-optimization gamedev-skills A skill that turns “the game runs slow” into a measured bottleneck and a specific fix: profile first, then pool objects, batch draw calls, cut allocations. Claude Code CX Codex Cursor +1 7,100installs game-ai gamedev-skills Designs NPC decision-making, behavior trees, steering forces, and A* pathfinding. Useful when building game enemy logic across engines. Claude Code CX Codex Cursor +1 7,100installs input-systems gamedev-skills Engine-neutral input system: map keys to named actions, rebinding with conflict detection, keyboard, gamepad and touch support, analog deadzones, input buffering and coyote time. Claude Code CX Codex Cursor +1 6,800installs

Similar

asset-pipeline rehan-remade Turns generated or hand-drawn art into files a game engine loads: sprite frames, animation strips, isometric unit renders from a 3D model. Claude Code CX Codex Cursor +1 1,500installs mashup-mods rehan-remade Skill for building cross-game mods: Minecraft inside Skyrim, skateboarding in MW2. Covers passthrough mods, porting content, and embedding one game into another. Claude Code CX Codex Cursor +1 1,500installs game-automation rehan-remade Launches games, captures GPU-rendered windows, and simulates mouse and keyboard input. Helps an agent verify mods directly inside a running game on Windows and WSL. Claude Code CX Codex Cursor +1 1,500installs orbit-card heygen-com Adds a 10-second 1920×1080 HyperFrames motion block where a single feature card orbits a dot sphere using exported Blender camera paths. Claude Code CX Codex Cursor +1 9,800installs sdf earthtojake This skill authors and validates SDFormat files for models and worlds, then helps prepare them for simulator handoff. Claude Code CX Codex Cursor +1 10,500installs urdf earthtojake This skill helps create, validate, and debug URDF robot descriptions. Use it when working with links, joints, geometry, meshes, or inertial data. Claude Code CX Codex Cursor +1 10,400installs hatch-pet official openai Creates and packages animated pets and spritesheets for Codex. Use it to turn a character concept, reference image, or brand cues into a pet. Claude Code CX Codex Cursor +1 3,300installs gcode earthtojake Slices STL, 3MF, and OBJ models into printer-ready G-code through OrcaSlicer. Use it when you need a print file without connecting to the printer. Claude Code CX Codex Cursor +1 9,500installs

Questions about godot-ui-control

How do I install godot-ui-control in Claude Code?

Run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-ui-control -a claude-code. The skill file lands at ~/.claude/skills/godot-ui-control/SKILL.md.

What does godot-ui-control do?

It shows the agent how to build Godot 4.7 interfaces from Control nodes: anchors and offsets, container layout, a Theme resource, and focus navigation for keyboard and gamepad.

Does it work for Godot 3 projects?

It targets 4.x, so the examples use size, position and custom_minimum_size, while Godot 3 calls them rect_size, rect_position and rect_min_size. Code from the skill needs rewriting there.

Source text

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor