godot-ui-control-sh-dajs24

Godot UI Control–specific skill that helps AI agents efficiently complete related tasks.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "godot-ui-control-sh-dajs24" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-2489cd0260c29a73a5745064b72fec511ae462707149f8ae40690a9a456767e2. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/godot-ui-control-sh-dajs24 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Godot UI Control–specific skill that helps AI agents efficiently complete related tasks.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
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.3+**.
Audience
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`.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: Godotuicontrol
slug: godot-ui-control
version: 1.0.0
displayName: Godotuicontrol
description: >
  Godotuicontrol专用技能,帮助AI Agent高效完成相关任务。
  Godotuicontrol专用技能,帮助AI Agent高效完成相关任务。
summary: "Godotuicontrol专用技能,帮助AI Agent高效完成相关任务。"
license: Apache-2.0
category: 游戏开发
framework:
  - Claude Code
  - Codex
  - Hermes Agent
  - OpenClaw
  - QClaw
  - WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"

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.3+.

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)

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 = 1

2. A menu built from containers + button signals

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

# 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)

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.
  • 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 not FOCUS_NONE.
  • 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'srect_size/rect_position/rect_min_size are nowsize/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.

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供Godot UI/Control节点的完整开发指南,涵盖响应式布局、主题样式、焦点导航等核心功能
  • 适用于游戏开发中的高频需求场景(如HUD、菜单、设置界面),具有明确的实用价值
Trigger Precision25/100

Areas to improve

  • description内容重复且不清晰 Reported severity: Major

    description字段重复相同内容两次,且未明确说明具体触发条件或使用场景,仅泛泛描述'Godotuicontrol专用技能'

    Recommendation: 建议重写description,明确说明该Skill适用的具体场景,如'用于Godot引擎中UI控件的响应式布局设计、主题样式配置和焦点导航设置'

Structure and Standards90/100

Areas to improve

  • 文档长度略长 Reported severity: Minor

    文档内容约600行,超过建议的500行限制

    Recommendation: 可考虑将部分内容移至引用文件中,保持主文档简洁

Highlights

  • 文档结构完整,包含When to use、Core workflow、Patterns、Pitfalls等清晰章节
  • 提供了丰富的GDScript代码示例和最佳实践指导
Execution Reliability85/100

Highlights

  • 提供的GDScript代码示例语法正确,符合Godot 4.3+规范
  • 覆盖了常见陷阱和异常处理建议,如focus_mode设置、mouse_filter配置等
Evidence Verifiability (mean of the first four)71/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.