ai-behavior-trees-util…
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
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
$ npx -y skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-ui-control --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/godot-ui-controlContext preview
The summary Claude sees to decide when to auto-load this skill.
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
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.
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**.
`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`.
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`).
extends Control
func _ready() -> void:
# Stretch this panel to fill its parent (equivalent to the "Full Rect" preset).
anchors_preset = Control.PRESET_FULL_RECT
# Or set anchors manually: all four edges at the parent's far corners.
# anchor_left = 0; anchor_top = 0; anchor_right = 1; anchor_bottom = 1extends 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()# 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 fillfunc _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"))position/anchors — the container owns layout. To free-place, take the node out of the container or use a plain `Control`/`PanelContainer` wrapper.
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.
correctly. Keep UI under a `CanvasLayer`/`Control` subtree.
`grab_focus()` on an initial control and ensure `focus_mode` is not `FOCUS_NONE`.
overrides one node. Overusing per-node overrides defeats centralized theming.
are now `size`/`position`/`custom_minimum_size` in 4.x.
set `MOUSE_FILTER_IGNORE` on purely decorative panels.
resources, focus neighbor wiring, and `CanvasLayer` for HUDs, read `references/layout-and-theming.md`.
<img src="docs/assets/banner.png" width="820" alt="awesome-gamedev-agent-skills — game-dev skills for AI coding agents.
Repo: gamedev-skills/awesome-gamedev-agent-skills
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system…
Implement game audio practice — bus/mixer architecture and gain in decibels, ducking (sidechain), adaptive/dynamic music via layering and re-sequencing, SFX…
Build game cameras that feel good — 2D follow with a deadzone, look-ahead, smoothing, and level-bounds clamping; 3D third-person orbit with collision and…
Plan, generate, source, normalize, and validate cohesive visual game assets. Use for art direction, style bibles, sprites, tilesets, backgrounds, UI art,…
Build branching dialogue and narrative — a node/choice graph with conditions, variables, and localization hooks — and choose between authoring tools Ink and…
Design NPC and enemy decision-making with finite state machines, behavior trees, steering behaviors, and A* pathfinding — engine-neutral algorithms that pair…