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`).
Ships in gamedev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
Control nodes;
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.
Read the stretch settings first. project.godot [display] holds
window/size/viewport_width/viewport_height (base size, default 1152x648),
window/stretch/mode (canvas_items is the usual choice for UI-heavy games) and
window/stretch/aspect (expand lets UI use extra width or height). Layout bugs on
other screens usually start here.
Use Control nodes for UI, not Node2D, and put HUDs under a CanvasLayer so 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 a VBoxContainer,
HBoxContainer, GridContainer or MarginContainer, the container owns position and
size; steer it with size_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 = 2
Keep whatever layout_mode line Godot wrote; it records whether anchors or a parent
container drive the node.
Style with one Theme. Set a project-wide theme with gui/theme/custom="res://ui/theme.tres"
in project.godot, or assign theme on the top Control; children inherit it. Use
per-node add_theme_*_override only for exceptions.
Wire focus. Give the first button focus when a menu opens (grab_focus()), keep
focus_mode = FOCUS_ALL on anything a gamepad must reach, and set
focus_neighbor_* only where the automatic geometry guess is wrong.
Connect signals (pressed, toggled, text_submitted, value_changed).
Check before you finish.
godot --headless --path . --script res://tests/test_ui_layout.gd and read the exit
code. It flags controls pushed off-screen and menus with nothing focused, at each size.godot-nodes-scenes skill's scripts/check_godot_project.py <project-dir> if you edited
.tscn/.tres files (themes, StyleBoxes, fonts).--headless), capture frames and look
at them: godot --path . --resolution 2560x1080 --write-movie $OUT/menu.png --quit-after 3 --scene res://ui/main_menu.tscn
writes numbered PNGs next to that path. Repeat at 1280x720.godot, godot4 or $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.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)
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()
func _ready() -> void:
$Label.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
$Spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL # grows to fill
# 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
for size in SIZES:
var vp := SubViewport.new()
vp.size = size
root.add_child(vp)
var ui: Control = load("res://ui/main_menu.tscn").instantiate()
vp.add_child(ui)
await process_frame
await process_frame # containers re-sort a frame later
var screen := Rect2(Vector2.ZERO, Vector2(size))
for node in ui.find_children("*", "Control", true, false):
var c := node as Control
if c.is_visible_in_tree() and not screen.encloses(c.get_global_rect()):
failed += 1
push_error("%s off-screen at %s: %s" % [ui.get_path_to(c), size, c.get_global_rect()])
if vp.gui_get_focus_owner() == null:
failed += 1
push_error("nothing has focus at %s, so a gamepad cannot navigate" % size)
vp.free()
print("Results: %d failed" % failed)
quit(1 if failed > 0 else 0)
Children of a ScrollContainer are meant to extend past it; skip them (or check only the
container) when the menu scrolls.
offset_transform_enabled = true and use
offset_transform_position/_rotation/_scale, which the container leaves alone.Node2D doesn't theme, anchor or take focus correctly. Keep UI in a
Control subtree, under a CanvasLayer for HUDs.grab_focus() when the screen opens;
plain Controls default to FOCUS_NONE, FOCUS_CLICK is mouse-only, and
grab_focus() on a FOCUS_NONE control only prints a warning.mouse_filter is STOP. Set
MOUSE_FILTER_IGNORE on decorative panels and HUD roots.aspect is keep (black bars) or the panel is anchored to a corner instead of the
edge it should follow. Test the sizes the UI actually gets (Pattern 4).add_theme_*_override calls beat the inherited Theme;
many of them defeat central theming and make restyling slow.rect_* properties are renamed. Godot 3's rect_size/rect_position/rect_min_size
are now size/position/custom_minimum_size.references/layout-and-theming.md when you need the anchor/offset maths, every
Container type, size-flag values, building a Theme and StyleBox in code, focus neighbour
wiring, offset transforms, the built-in VirtualJoystick, or common Control signals.game-ui-ux for engine-neutral rules: scaling, safe areas, focus flow, screen stack.godot-animation for Tween-based UI transitions.godot-signals-groups for wiring UI events to game logic.input-systems for rebindable input and multi-device focus.card-game / visual-novel for UI-heavy genre templates.Last verified: 2026-11-11 against Godot 4.7.2-stable (released 2026-08-18).
Control.offset_transform_* and the VirtualJoystick node are new in 4.7.disabled, aspect keep.--write-movie with a .png path writes an image sequence; --resolution requests the
window size.Sources: Control @ 4.7.2-stable, ProjectSettings @ 4.7.2-stable, main.cpp @ 4.7.2-stable, Multiple resolutions, Godot 4.7 release.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/gamedev:godot-ui-controlfrom gamedev
npx claudepluginhub cirobarone78/games-skill --plugin gamedev80 skills in this plugin
/ai-behavior-trees-utility-aiEngine-neutral behavior tree and utility AI code for NPCs in any language: Blackboard, reactive composites, decorators and response-curve scoring. Use when an enemy keeps chasing after losing sight, restarts its action every frame or flip-flops between choices. Not for FSMs, steering or pathfinding (`game-ai`) or Unreal BT, EQS and StateTree (`unreal-behavior-trees`).
/audio-designEngine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive music and SFX variation, with Godot, Unity and FMOD/Wwise mappings. Use when mixing a game, making music react to combat, fixing repetitive footsteps or beat sync, or a mix that clips or pumps. Not for the Godot audio API (`godot-audio`).
/bevy-ecsBuilds and debugs Bevy 0.20 games in Rust: components, Query and Commands systems, schedules, States, observers and headless tests. Use when Cargo.toml depends on bevy, on a B0001 query-conflict panic, or pre-0.20 code (EventReader, SpriteBundle). Not for engine-neutral AI, generation, physics or shaders (`game-ai`, `procedural-gen`, `physics-tuning`, `shader-programming`).
/camera-systemsBuilds and tunes game cameras, engine-neutral with Godot and Cinemachine 3 mappings: 2D follow with deadzone and look-ahead, third-person orbit, first-person look and split-screen. Use when the camera lags, jitters while following, shows past the level edge, clips through walls or changes with frame rate. Not for shake (`game-feel`) or physics timestep jitter (`physics-tuning`).
/card-gameDesigns card games and deckbuilders in any engine: cards as data with one effect interpreter, deck zones, a trigger stack and seeded shuffles. Use for a Slay the Spire- or Balatro-like or a TCG, or cards that duplicate or streaky shuffles. Pair with the engine skill for card data and hand UI (`godot-resources`, `godot-ui-control`, `unity-scriptableobjects`). Not for grid crawlers (`roguelike`).
/create-game-assetsPlans, generates or sources, and validates consistent game art: style guides, sprites, pixel art, tilesets, icons and textures, with QA and licence records. Use when making or AI-generating game art, fixing fake transparency, or checking Steam AI disclosure. Not for engine import (`godot-tilemap`, `godot-animation`, `unity-tilemap-2d`), UI layout (`game-ui-ux`) or sound (`audio-design`).