[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KRAQMVAC24379NWF4K4TTZ":3,"skill-same:01M6KRAQMVAC24379NWF4K4TTZ":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6KRAQMVAC24379NWF4K4TTZ","godot-ui",null,"Use when building user interfaces — Control nodes, themes, anchors, containers, and layout patterns","jame581\u002FGodotPrompter","jame581","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21112138?v=4","01M6KR3KEQ9Z30WVJRR2E2ZVXE","Jan Mesarč","01M6KR3KJVRMPDSMASQPBCBVK3",964,"MIT","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35],"godot ui","ui","godot","containers","themes","use","Nodes","control","layout","patterns","user","when","2026-11-10 10:12:30",false,"---\nname: godot-ui\ndescription: Use when building user interfaces — Control nodes, themes, anchors, containers, and layout patterns\n---\n\n# Godot UI — Control Nodes, Themes & Layout\n\nAll examples target Godot 4.3+ with no deprecated APIs; GDScript first, then C#.\n\n> **Related skills:** **responsive-ui** for multi-resolution scaling, **hud-system** for in-game HUD patterns, **dialogue-system** for dialogue UI presentation, **tween-animation** for UI transition and animation effects.\n\n---\n\n## 1. Control Node Hierarchy\n\n### How Control Differs from Node2D\n\n`Control` is the base class for all UI nodes — it lives in a separate scene-tree branch from `Node2D`\u002F`Node3D` with a fundamentally different layout model.\n\n| Feature | `Node2D` | `Control` |\n|---|---|---|\n| Position model | World-space `position` (pixels from parent) | Anchor + offset relative to parent rect |\n| Size | No intrinsic size | Has `size`, `custom_minimum_size`, and a computed minimum (`get_combined_minimum_size()`) |\n| Theme | None | Inherits and overrides `Theme` resources |\n| Focus | Not applicable | Built-in focus system (`focus_mode`, `grab_focus()`) |\n| Mouse events | Manual via `_input` | `gui_input`, `mouse_entered`, `mouse_exited` |\n| Layout helpers | None | `Container` subclasses auto-arrange children |\n\n### Control as Base Class\n\nEvery UI widget (`Button`, `Label`, `LineEdit`, etc.) extends `Control`. Key properties defined on `Control` itself:\n\n- `anchor_left`, `anchor_top`, `anchor_right`, `anchor_bottom` — fractional values (0.0–1.0) relative to the parent rect\n- `offset_left`, `offset_top`, `offset_right`, `offset_bottom` — pixel offsets applied after the anchor resolves\n- `size_flags_horizontal`, `size_flags_vertical` — how the node participates in `Container` layout\n- `theme` — a `Theme` resource; lookups check each ancestor `Control`\u002F`Window` that has one, nearest first, and stop at the first parent that is neither (e.g. a `CanvasLayer` or `Node2D`)\n- `focus_mode` — whether the node can receive keyboard\u002Fgamepad focus\n\nPlace UI nodes inside a `CanvasLayer` so they render on top of the 3D\u002F2D world, unaffected by `Camera2D` transforms. Controls on the scene root's built-in canvas (layer 0) move with a `Camera2D`, because the camera sets that canvas's transform.\n\n> ⚠️ **Changed in Godot 4.7:** `Control.accessibility_live` changed type from `DisplayServer.AccessibilityLiveMode` to `AccessibilityServer.AccessibilityLiveMode` (`LIVE_OFF = 0` default, `LIVE_POLITE`, `LIVE_ASSERTIVE`) — accessibility enums\u002FAPIs moved to the new `AccessibilityServer` singleton. GDScript-compatible; breaks C# binary\u002Fsource compatibility (rebuild against the new enum). See the [4.7 migration guide](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Flatest\u002Ftutorials\u002Fmigrating\u002Fupgrading_to_godot_4.7.html).\n\n---\n\n## 2. Common Container Nodes\n\n| Container | Purpose | When to Use |\n|---|---|---|\n| `VBoxContainer` | Stacks children vertically | Lists, option rows, vertical menus |\n| `HBoxContainer` | Stacks children horizontally | Toolbars, stat rows, horizontal nav |\n| `GridContainer` | Arranges children in a fixed-column grid | Inventory grids, key-binding tables |\n| `MarginContainer` | Adds padding around a single child | Wrapping any node to give it breathing room |\n| `PanelContainer` | Draws a `StyleBox` background, then lays out children | Card UI, dialog boxes, HUD panels |\n| `ScrollContainer` | Makes its single child scrollable; clips overflow | Long lists, logs, scrollable settings |\n| `TabContainer` | Stacks children as named tabs; shows one at a time | Settings screens, multi-section panels |\n\n**Sizing tips:**\n- Set `size_flags_horizontal = SIZE_EXPAND_FILL` on children that should fill available space.\n- Use `custom_minimum_size` to prevent a child from collapsing to zero.\n- `MarginContainer` reads margin from the theme property `margin_*`; override at runtime with `add_theme_constant_override(\"margin_left\", 16)`.\n\n> **Godot 4.7+:** `custom_maximum_size` (`Vector2(-1, -1)`) caps size per axis, prioritized over `custom_minimum_size`; `propagate_maximum_size` (default `false`) makes a parent's maximum constrain its Control children; `_get_maximum_size()` computes maximums from code.\n\n> ⚠️ **Changed in Godot 4.7:** `TabContainer.all_tabs_in_front` is deprecated — it does nothing now, since tabs are always in front. Remove code that sets it. See [GH-118623](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F118623).\n\n> **Godot 4.8+:** `TabBar` \u002F `TabContainer.tab_sizing` (`TAB_SIZING_*`), `BoxContainer.reverse_sort`, `BaseButton.press()` (no visual-state change, no focus grab) and `SpinBox.format` (deprecates `prefix` \u002F `suffix`).\n\n---\n\n## 3. Anchors & Margins\n\n### How Anchor Presets Work\n\nAn anchor is a point on the **parent** rect expressed as a fraction (0 = top\u002Fleft edge, 1 = bottom\u002Fright edge). Godot resolves the final pixel position of each edge as:\n\n```\nfinal_left   = parent_width  * anchor_left   + offset_left\nfinal_top    = parent_height * anchor_top    + offset_top\nfinal_right  = parent_width  * anchor_right  + offset_right\nfinal_bottom = parent_height * anchor_bottom + offset_bottom\n```\n\nThe editor exposes built-in presets:\n\n| Preset | Anchor values | Use case |\n|---|---|---|\n| Full Rect | L=0, T=0, R=1, B=1 | Overlay \u002F fill parent — most common for root UI |\n| Center | L=0.5, T=0.5, R=0.5, B=0.5 | Fixed-size widget centred in parent |\n| Top Left | L=0, T=0, R=0, B=0 | Fixed-size widget pinned to top-left corner |\n| Top Right | L=1, T=0, R=1, B=0 | Fixed-size widget pinned to top-right corner |\n| Bottom Center | L=0.5, T=1, R=0.5, B=1 | HUD element anchored to bottom centre |\n\n### Setting Anchors in Code\n\nAnchors resolve as `parent_size * anchor + offset` per edge, so setting them by hand means setting eight properties. `set_anchors_and_offsets_preset(Control.PRESET_*)` does it in one call — use that, then adjust `offset_*` for margins (negative on right\u002Fbottom).\n\nThe anchor-vs-offset rule (keep offsets at 0 and let anchors do the work) plus full GDScript + C# examples — full-rect fill, top-right HUD with 16 px margins, and a custom half-screen side panel: [references\u002Fanchors-in-code.md](references\u002Fanchors-in-code.md)\n\n---\n\n## 4. Theme System\n\nA `Theme` resource centralizes fonts, colors, and `StyleBox`es. Apply at the root and let inheritance do the work; use `theme_override_*` only for one-off tweaks. `StyleBoxFlat` covers most flat-design needs (`bg_color`, `border_color`, `corner_radius_*`, `border_width_*`); `StyleBoxTexture` for textures.\n\n> See [references\u002Ftheme-system.md](references\u002Ftheme-system.md) for the full Theme resource creation walk-through, StyleBoxFlat properties, font overrides, theme inheritance rules, and per-node `theme_override_*` methods.\n\n> **Godot 4.7+:** `GradientTexture2D`'s `Fill` enum gains `FILL_CONIC` — colors interpolated in a cone (angular) pattern; radial progress\u002Fcooldown indicators without a shader (C#: `FillEnum.Conic`).\n\n> **Godot 4.8+:** Themes carry sounds: `Theme.set_sound()` items such as `BaseButton`'s `pressed_sound` \u002F `hover_sound` replace per-button `AudioStreamPlayer` wiring and play on the `audio\u002Fbuses\u002Fgui_theme_bus` bus. Recipe: [references\u002Ftheme-system.md](references\u002Ftheme-system.md#theme-sounds-godot-48).\n\n---\n\n## 5. Focus & Navigation\n\nFocus modes (`FOCUS_NONE`, `FOCUS_CLICK`, `FOCUS_ALL`) gate keyboard\u002Fgamepad navigation. Wire chains with `focus_neighbor_top` \u002F `_bottom` \u002F `_left` \u002F `_right`, or rely on automatic spatial detection. Call `grab_focus()` on the first interactive element when a menu opens.\n\n> **Changed in Godot 4.8:** `gui\u002Fcommon\u002Fauto_focus_strategy` picks how automatic neighbors are inferred: `Legacy` (class default, the 4.7 behavior) or `Balloon` (closest and most aligned Control in the input direction). New 4.8 projects get `Balloon`, so automatic navigation can differ from an upgraded project; set neighbors explicitly where it matters.\n\n> See [references\u002Ffocus-and-navigation.md](references\u002Ffocus-and-navigation.md) for focus mode details, `focus_neighbor` chain examples, gamepad\u002Fkeyboard input handling, and grab_focus patterns.\n\n---\n\n## 6. Common UI Patterns\n\nThree canonical scenes: a **main menu** (centered VBoxContainer with title + button list), a **settings screen with tabs** (`TabContainer` + child panels per category), and a **pause menu overlay** (full-rect `ColorRect` background + centered options panel, paused via `get_tree().paused = true`).\n\n> See [references\u002Fui-patterns.md](references\u002Fui-patterns.md) for the full scene-tree fragments and GDScript wiring for each pattern.\n\n> **Godot 4.8+:** `Label` \u002F `RichTextLabel.resize_font_to_fit = true` picks the largest size between `minimum_font_size` and `maximum_font_size` that does not truncate (`get_rendered_font_size()` reads it), so no hand-rolled shrink loops.\n\n> **Godot 4.7+:** `offset_transform_*` — visual-only UI-juice transform (shake\u002Fpulse) that never re-triggers container layout; `_get_cursor_shape(at_position)` — per-position cursor shapes; `PopupMenu` search bar (`search_bar_enabled`, fuzzy by default) plus `set_item_index()` for reordering; `TextureRect` `STRETCH_TILE` now tiles `AtlasTexture`s (only non-zero `margin` unsupported). Code: [references\u002Fui-patterns.md](references\u002Fui-patterns.md#godot-47-additions).\n\n> ⚠️ **Changed in Godot 4.7:** `RichTextLabel.add_image()` \u002F `update_image()` sizing was reworked — `width`\u002F`height` are now `float`; `width_in_percent`\u002F`height_in_percent` bools become `width_unit`\u002F`height_unit`, taking the new `ImageUnit` enum (`IMAGE_UNIT_PIXEL`, `IMAGE_UNIT_PERCENT`, `IMAGE_UNIT_EM` — em scales with font size). `ImageUpdateMask.UPDATE_WIDTH_IN_PERCENT` is renamed `UPDATE_WIDTH_UNIT`, breaking GDScript using the old name. See the [4.7 migration guide](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Flatest\u002Ftutorials\u002Fmigrating\u002Fupgrading_to_godot_4.7.html).\n\n---\n\n## 7. Signals\n\n`Button.pressed` for clicks, `Control.gui_input` for raw events on a node, `Control.mouse_entered` \u002F `mouse_exited` for hover. Connect in `_ready()` or via the Inspector's Node panel.\n\n> See [references\u002Fsignals.md](references\u002Fsignals.md) for the complete signal catalog and signal-driven UI update patterns.\n\n---\n\n## 8. FoldableContainer (Godot 4.5+)\n\n`FoldableContainer` is a built-in accordion `Container` added in Godot 4.5 — a toggle header plus collapsible children, replacing the old boilerplate of wiring a `Button` to show\u002Fhide a `VBoxContainer`. Set `title`, set `folded` for the initial state, add children normally, and listen to `folding_changed(is_folded)`.\n\nFull GDScript + C# construction, the key-properties table, and the toggle signal: [references\u002Ffoldable-container.md](references\u002Ffoldable-container.md)\n\n---\n\n## 9. Stacked Label Effects (Godot 4.5+)\n\nGodot 4.5 lets a `Label` layer several outlines and shadows through its `LabelSettings` resource — e.g. two outlines at different widths\u002Fcolors plus a soft drop shadow. The stack lives on `LabelSettings` (configured per index), not on theme overrides, and `RichTextLabel` has no equivalent. Previously, multiple outline layers required duplicating and manually layering Label nodes.\n\n```gdscript\n# Stacked effects live on LabelSettings and are configured per index.\nfunc apply_stacked_outlines(label: Label) -> void:\n    var settings := LabelSettings.new()\n    settings.outline_size = 4                  # base (inner) outline\n    settings.outline_color = Color.BLACK\n\n    settings.add_stacked_outline()             # stacked outline 0, drawn outside the base one\n    settings.set_stacked_outline_size(0, 8)\n    settings.set_stacked_outline_color(0, Color.GOLD)\n\n    settings.add_stacked_shadow()              # stacked shadow 0\n    settings.set_stacked_shadow_offset(0, Vector2(3, 3))\n    settings.set_stacked_shadow_color(0, Color(0.0, 0.0, 0.0, 0.5))\n    settings.set_stacked_shadow_outline_size(0, 2)\n\n    label.label_settings = settings            # takes priority over theme properties\n```\n\n```csharp\npublic void ApplyStackedOutlines(Label label)\n{\n    var settings = new LabelSettings { OutlineSize = 4, OutlineColor = Colors.Black };\n\n    settings.AddStackedOutline();\n    settings.SetStackedOutlineSize(0, 8);\n    settings.SetStackedOutlineColor(0, Colors.Gold);\n\n    settings.AddStackedShadow();\n    settings.SetStackedShadowOffset(0, new Vector2(3, 3));\n    settings.SetStackedShadowColor(0, new Color(0f, 0f, 0f, 0.5f));\n    settings.SetStackedShadowOutlineSize(0, 2);\n\n    label.LabelSettings = settings;\n}\n```\n\n`RichTextLabel` cannot stack effects; it takes one outline per text run through BBCode: `[outline_size=4][outline_color=#000000]Level Up![\u002Foutline_color][\u002Foutline_size]`.\n\n> **Editor workflow:** Create a `LabelSettings` resource in the Label's **Label Settings** property and add entries to its stacked outline and stacked shadow lists. The per-index calls above cover dynamic scenarios.\n\n---\n\n## 10. Checklist\n\n- [ ] Root UI `Control` has anchor preset **Full Rect** (or appropriate preset for the layout)\n- [ ] All interactive widgets (`Button`, `LineEdit`, `Slider`) have `focus_mode = FOCUS_ALL`\n- [ ] Decorative nodes (`Label`, `TextureRect`) have `focus_mode = FOCUS_NONE`\n- [ ] Focus neighbours wired for non-linear layouts so gamepad navigation wraps correctly\n- [ ] `grab_focus()` called on the first interactive widget in `_ready()` for each screen\n- [ ] Pause menu root `Control` has `process_mode = PROCESS_MODE_ALWAYS`\n- [ ] One `Theme` resource assigned at the screen root — not duplicated on every child\n- [ ] `StyleBoxFlat` used instead of image assets for simple solid-colour panels\n- [ ] `add_theme_*_override()` used for per-node overrides rather than assigning a whole new `Theme`\n- [ ] Containers (`VBoxContainer`, `HBoxContainer`, etc.) used for layout instead of manual `position` values\n- [ ] `custom_minimum_size` set on widgets that must not collapse to zero\n- [ ] Slider and volume code uses `linear_to_db` \u002F `db_to_linear` — not raw linear values mapped to audio bus\n- [ ] Signals connected in `_ready()` (or via the editor); no polling of UI state in `_process`\n- [ ] Tab order in `TabContainer` matches logical reading \u002F navigation order\n- [ ] Accordion-style collapsible panels use `FoldableContainer` instead of manual Button + VBoxContainer wiring (Godot 4.5+)\n- [ ] Multiple outline\u002Fshadow layers on a `Label` use `LabelSettings` stacked outlines\u002Fshadows instead of duplicated nodes (Godot 4.5+)\n","# Godot UI — Control Nodes, Themes & Layout\n\nAll examples target Godot 4.3+ with no deprecated APIs; GDScript first, then C#.\n\n> **Related skills:** **responsive-ui** for multi-resolution scaling, **hud-system** for in-game HUD patterns, **dialogue-system** for dialogue UI presentation, **tween-animation** for UI transition and animation effects.\n\n---\n\n## 1. Control Node Hierarchy\n\n### How Control Differs from Node2D\n\n`Control` is the base class for all UI nodes — it lives in a separate scene-tree branch from `Node2D`\u002F`Node3D` with a fundamentally different layout model.\n\n| Feature | `Node2D` | `Control` |\n|---|---|---|\n| Position model | World-space `position` (pixels from parent) | Anchor + offset relative to parent rect |\n| Size | No intrinsic size | Has `size`, `custom_minimum_size`, and a computed minimum (`get_combined_minimum_size()`) |\n| Theme | None | Inherits and overrides `Theme` resources |\n| Focus | Not applicable | Built-in focus system (`focus_mode`, `grab_focus()`) |\n| Mouse events | Manual via `_input` | `gui_input`, `mouse_entered`, `mouse_exited` |\n| Layout helpers | None | `Container` subclasses auto-arrange children |\n\n### Control as Base Class\n\nEvery UI widget (`Button`, `Label`, `LineEdit`, etc.) extends `Control`. Key properties defined on `Control` itself:\n\n- `anchor_left`, `anchor_top`, `anchor_right`, `anchor_bottom` — fractional values (0.0–1.0) relative to the parent rect\n- `offset_left`, `offset_top`, `offset_right`, `offset_bottom` — pixel offsets applied after the anchor resolves\n- `size_flags_horizontal`, `size_flags_vertical` — how the node participates in `Container` layout\n- `theme` — a `Theme` resource; lookups check each ancestor `Control`\u002F`Window` that has one, nearest first, and stop at the first parent that is neither (e.g. a `CanvasLayer` or `Node2D`)\n- `focus_mode` — whether the node can receive keyboard\u002Fgamepad focus\n\nPlace UI nodes inside a `CanvasLayer` so they render on top of the 3D\u002F2D world, unaffected by `Camera2D` transforms. Controls on the scene root's built-in canvas (layer 0) move with a `Camera2D`, because the camera sets that canvas's transform.\n\n> ⚠️ **Changed in Godot 4.7:** `Control.accessibility_live` changed type from `DisplayServer.AccessibilityLiveMode` to `AccessibilityServer.AccessibilityLiveMode` (`LIVE_OFF = 0` default, `LIVE_POLITE`, `LIVE_ASSERTIVE`) — accessibility enums\u002FAPIs moved to the new `AccessibilityServer` singleton. GDScript-compatible; breaks C# binary\u002Fsource compatibility (rebuild against the new enum). See the [4.7 migration guide](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Flatest\u002Ftutorials\u002Fmigrating\u002Fupgrading_to_godot_4.7.html).\n\n---\n\n## 2. Common Container Nodes\n\n| Container | Purpose | When to Use |\n|---|---|---|\n| `VBoxContainer` | Stacks children vertically | Lists, option rows, vertical menus |\n| `HBoxContainer` | Stacks children horizontally | Toolbars, stat rows, horizontal nav |\n| `GridContainer` | Arranges children in a fixed-column grid | Inventory grids, key-binding tables |\n| `MarginContainer` | Adds padding around a single child | Wrapping any node to give it breathing room |\n| `PanelContainer` | Draws a `StyleBox` background, then lays out children | Card UI, dialog boxes, HUD panels |\n| `ScrollContainer` | Makes its single child scrollable; clips overflow | Long lists, logs, scrollable settings |\n| `TabContainer` | Stacks children as named tabs; shows one at a time | Settings screens, multi-section panels |\n\n**Sizing tips:**\n- Set `size_flags_horizontal = SIZE_EXPAND_FILL` on children that should fill available space.\n- Use `custom_minimum_size` to prevent a child from collapsing to zero.\n- `MarginContainer` reads margin from the theme property `margin_*`; override at runtime with `add_theme_constant_override(\"margin_left\", 16)`.\n\n> **Godot 4.7+:** `custom_maximum_size` (`Vector2(-1, -1)`) caps size per axis, prioritized over `custom_minimum_size`; `propagate_maximum_size` (default `false`) makes a parent's maximum constrain its Control children; `_get_maximum_size()` computes maximums from code.\n\n> ⚠️ **Changed in Godot 4.7:** `TabContainer.all_tabs_in_front` is deprecated — it does nothing now, since tabs are always in front. Remove code that sets it. See [GH-118623](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F118623).\n\n> **Godot 4.8+:** `TabBar` \u002F `TabContainer.tab_sizing` (`TAB_SIZING_*`), `BoxContainer.reverse_sort`, `BaseButton.press()` (no visual-state change, no focus grab) and `SpinBox.format` (deprecates `prefix` \u002F `suffix`).\n\n---\n\n## 3. Anchors & Margins\n\n### How Anchor Presets Work\n\nAn anchor is a point on the **parent** rect expressed as a fraction (0 = top\u002Fleft edge, 1 = bottom\u002Fright edge). Godot resolves the final pixel position of each edge as:\n\n```\nfinal_left   = parent_width  * anchor_left   + offset_left\nfinal_top    = parent_height * anchor_top    + offset_top\nfinal_right  = parent_width  * anchor_right  + offset_right\nfinal_bottom = parent_height * anchor_bottom + offset_bottom\n```\n\nThe editor exposes built-in presets:\n\n| Preset | Anchor values | Use case |\n|---|---|---|\n| Full Rect | L=0, T=0, R=1, B=1 | Overlay \u002F fill parent — most common for root UI |\n| Center | L=0.5, T=0.5, R=0.5, B=0.5 | Fixed-size widget centred in parent |\n| Top Left | L=0, T=0, R=0, B=0 | Fixed-size widget pinned to top-left corner |\n| Top Right | L=1, T=0, R=1, B=0 | Fixed-size widget pinned to top-right corner |\n| Bottom Center | L=0.5, T=1, R=0.5, B=1 | HUD element anchored to bottom centre |\n\n### Setting Anchors in Code\n\nAnchors resolve as `parent_size * anchor + offset` per edge, so setting them by hand means setting eight properties. `set_anchors_and_offsets_preset(Control.PRESET_*)` does it in one call — use that, then adjust `offset_*` for margins (negative on right\u002Fbottom).\n\nThe anchor-vs-offset rule (keep offsets at 0 and let anchors do the work) plus full GDScript + C# examples — full-rect fill, top-right HUD with 16 px margins, and a custom half-screen side panel: [references\u002Fanchors-in-code.md](references\u002Fanchors-in-code.md)\n\n---\n\n## 4. Theme System\n\nA `Theme` resource centralizes fonts, colors, and `StyleBox`es. Apply at the root and let inheritance do the work; use `theme_override_*` only for one-off tweaks. `StyleBoxFlat` covers most flat-design needs (`bg_color`, `border_color`, `corner_radius_*`, `border_width_*`); `StyleBoxTexture` for textures.\n\n> See [references\u002Ftheme-system.md](references\u002Ftheme-system.md) for the full Theme resource creation walk-through, StyleBoxFlat properties, font overrides, theme inheritance rules, and per-node `theme_override_*` methods.\n\n> **Godot 4.7+:** `GradientTexture2D`'s `Fill` enum gains `FILL_CONIC` — colors interpolated in a cone (angular) pattern; radial progress\u002Fcooldown indicators without a shader (C#: `FillEnum.Conic`).\n\n> **Godot 4.8+:** Themes carry sounds: `Theme.set_sound()` items such as `BaseButton`'s `pressed_sound` \u002F `hover_sound` replace per-button `AudioStreamPlayer` wiring and play on the `audio\u002Fbuses\u002Fgui_theme_bus` bus. Recipe: [references\u002Ftheme-system.md](references\u002Ftheme-system.md#theme-sounds-godot-48).\n\n---\n\n## 5. Focus & Navigation\n\nFocus modes (`FOCUS_NONE`, `FOCUS_CLICK`, `FOCUS_ALL`) gate keyboard\u002Fgamepad navigation. Wire chains with `focus_neighbor_top` \u002F `_bottom` \u002F `_left` \u002F `_right`, or rely on automatic spatial detection. Call `grab_focus()` on the first interactive element when a menu opens.\n\n> **Changed in Godot 4.8:** `gui\u002Fcommon\u002Fauto_focus_strategy` picks how automatic neighbors are inferred: `Legacy` (class default, the 4.7 behavior) or `Balloon` (closest and most aligned Control in the input direction). New 4.8 projects get `Balloon`, so automatic navigation can differ from an upgraded project; set neighbors explicitly where it matters.\n\n> See [references\u002Ffocus-and-navigation.md](references\u002Ffocus-and-navigation.md) for focus mode details, `focus_neighbor` chain examples, gamepad\u002Fkeyboard input handling, and grab_focus patterns.\n\n---\n\n## 6. Common UI Patterns\n\nThree canonical scenes: a **main menu** (centered VBoxContainer with title + button list), a **settings screen with tabs** (`TabContainer` + child panels per category), and a **pause menu overlay** (full-rect `ColorRect` background + centered options panel, paused via `get_tree().paused = true`).\n\n> See [references\u002Fui-patterns.md](references\u002Fui-patterns.md) for the full scene-tree fragments and GDScript wiring for each pattern.\n\n> **Godot 4.8+:** `Label` \u002F `RichTextLabel.resize_font_to_fit = true` picks the largest size between `minimum_font_size` and `maximum_font_size` that does not truncate (`get_rendered_font_size()` reads it), so no hand-rolled shrink loops.\n\n> **Godot 4.7+:** `offset_transform_*` — visual-only UI-juice transform (shake\u002Fpulse) that never re-triggers container layout; `_get_cursor_shape(at_position)` — per-position cursor shapes; `PopupMenu` search bar (`search_bar_enabled`, fuzzy by default) plus `set_item_index()` for reordering; `TextureRect` `STRETCH_TILE` now tiles `AtlasTexture`s (only non-zero `margin` unsupported). Code: [references\u002Fui-patterns.md](references\u002Fui-patterns.md#godot-47-additions).\n\n> ⚠️ **Changed in Godot 4.7:** `RichTextLabel.add_image()` \u002F `update_image()` sizing was reworked — `width`\u002F`height` are now `float`; `width_in_percent`\u002F`height_in_percent` bools become `width_unit`\u002F`height_unit`, taking the new `ImageUnit` enum (`IMAGE_UNIT_PIXEL`, `IMAGE_UNIT_PERCENT`, `IMAGE_UNIT_EM` — em scales with font size). `ImageUpdateMask.UPDATE_WIDTH_IN_PERCENT` is renamed `UPDATE_WIDTH_UNIT`, breaking GDScript using the old name. See the [4.7 migration guide](https:\u002F\u002Fdocs.godotengine.org\u002Fen\u002Flatest\u002Ftutorials\u002Fmigrating\u002Fupgrading_to_godot_4.7.html).\n\n---\n\n## 7. Signals\n\n`Button.pressed` for clicks, `Control.gui_input` for raw events on a node, `Control.mouse_entered` \u002F `mouse_exited` for hover. Connect in `_ready()` or via the Inspector's Node panel.\n\n> See [references\u002Fsignals.md](references\u002Fsignals.md) for the complete signal catalog and signal-driven UI update patterns.\n\n---\n\n## 8. FoldableContainer (Godot 4.5+)\n\n`FoldableContainer` is a built-in accordion `Container` added in Godot 4.5 — a toggle header plus collapsible children, replacing the old boilerplate of wiring a `Button` to show\u002Fhide a `VBoxContainer`. Set `title`, set `folded` for the initial state, add children normally, and listen to `folding_changed(is_folded)`.\n\nFull GDScript + C# construction, the key-properties table, and the toggle signal: [references\u002Ffoldable-container.md](references\u002Ffoldable-container.md)\n\n---\n\n## 9. Stacked Label Effects (Godot 4.5+)\n\nGodot 4.5 lets a `Label` layer several outlines and shadows through its `LabelSettings` resource — e.g. two outlines at different widths\u002Fcolors plus a soft drop shadow. The stack lives on `LabelSettings` (configured per index), not on theme overrides, and `RichTextLabel` has no equivalent. Previously, multiple outline layers required duplicating and manually layering Label nodes.\n\n```gdscript\n# Stacked effects live on LabelSettings and are configured per index.\nfunc apply_stacked_outlines(label: Label) -> void:\n    var settings := LabelSettings.new()\n    settings.outline_size = 4                  # base (inner) outline\n    settings.outline_color = Color.BLACK\n\n    settings.add_stacked_outline()             # stacked outline 0, drawn outside the base one\n    settings.set_stacked_outline_size(0, 8)\n    settings.set_stacked_outline_color(0, Color.GOLD)\n\n    settings.add_stacked_shadow()              # stacked shadow 0\n    settings.set_stacked_shadow_offset(0, Vector2(3, 3))\n    settings.set_stacked_shadow_color(0, Color(0.0, 0.0, 0.0, 0.5))\n    settings.set_stacked_shadow_outline_size(0, 2)\n\n    label.label_settings = settings            # takes priority over theme properties\n```\n\n```csharp\npublic void ApplyStackedOutlines(Label label)\n{\n    var settings = new LabelSettings { OutlineSize = 4, OutlineColor = Colors.Black };\n\n    settings.AddStackedOutline();\n    settings.SetStackedOutlineSize(0, 8);\n    settings.SetStackedOutlineColor(0, Colors.Gold);\n\n    settings.AddStackedShadow();\n    settings.SetStackedShadowOffset(0, new Vector2(3, 3));\n    settings.SetStackedShadowColor(0, new Color(0f, 0f, 0f, 0.5f));\n    settings.SetStackedShadowOutlineSize(0, 2);\n\n    label.LabelSettings = settings;\n}\n```\n\n`RichTextLabel` cannot stack effects; it takes one outline per text run through BBCode: `[outline_size=4][outline_color=#000000]Level Up![\u002Foutline_color][\u002Foutline_size]`.\n\n> **Editor workflow:** Create a `LabelSettings` resource in the Label's **Label Settings** property and add entries to its stacked outline and stacked shadow lists. The per-index calls above cover dynamic scenarios.\n\n---\n\n## 10. Checklist\n\n- [ ] Root UI `Control` has anchor preset **Full Rect** (or appropriate preset for the layout)\n- [ ] All interactive widgets (`Button`, `LineEdit`, `Slider`) have `focus_mode = FOCUS_ALL`\n- [ ] Decorative nodes (`Label`, `TextureRect`) have `focus_mode = FOCUS_NONE`\n- [ ] Focus neighbours wired for non-linear layouts so gamepad navigation wraps correctly\n- [ ] `grab_focus()` called on the first interactive widget in `_ready()` for each screen\n- [ ] Pause menu root `Control` has `process_mode = PROCESS_MODE_ALWAYS`\n- [ ] One `Theme` resource assigned at the screen root — not duplicated on every child\n- [ ] `StyleBoxFlat` used instead of image assets for simple solid-colour panels\n- [ ] `add_theme_*_override()` used for per-node overrides rather than assigning a whole new `Theme`\n- [ ] Containers (`VBoxContainer`, `HBoxContainer`, etc.) used for layout instead of manual `position` values\n- [ ] `custom_minimum_size` set on widgets that must not collapse to zero\n- [ ] Slider and volume code uses `linear_to_db` \u002F `db_to_linear` — not raw linear values mapped to audio bus\n- [ ] Signals connected in `_ready()` (or via the editor); no polling of UI state in `_process`\n- [ ] Tab order in `TabContainer` matches logical reading \u002F navigation order\n- [ ] Accordion-style collapsible panels use `FoldableContainer` instead of manual Button + VBoxContainer wiring (Godot 4.5+)\n- [ ] Multiple outline\u002Fshadow layers on a `Label` use `LabelSettings` stacked outlines\u002Fshadows instead of duplicated nodes (Godot 4.5+)\n",{"name":5,"description":7},"master","60c28fdc40706a24576731e9fb3508b9c95258ad","skills\u002Fgodot-ui",63,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter","https:\u002F\u002Fgithub.com\u002Fjame581","https:\u002F\u002Fjanmesarc.online\u002F","Software engineer. My biggest passion is game development.","2026-11-14 20:45:49",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add jame581\u002FGodotPrompter --skill godot-ui",{"tool":56,"command":57},"bunx","bunx skills add jame581\u002FGodotPrompter --skill godot-ui",{"tool":59,"command":60},"pnpm","pnpm dlx skills add jame581\u002FGodotPrompter --skill godot-ui","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002FSKILL.md",true,[64,70,74,78,82,86],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fanchors-in-code.md","REFERENCE","参考文档",1936,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002Freferences\u002Fanchors-in-code.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Ffocus-and-navigation.md",3005,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002Freferences\u002Ffocus-and-navigation.md",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Ffoldable-container.md",2307,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002Freferences\u002Ffoldable-container.md",{"path":79,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fsignals.md",2547,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002Freferences\u002Fsignals.md",{"path":83,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Ftheme-system.md",5666,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002Freferences\u002Ftheme-system.md",{"path":87,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fui-patterns.md",12767,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-ui\u002Freferences\u002Fui-patterns.md",[91,110,131,161,181,198],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":36},"01M6KRFE5BR2PSD08ZKDAS66R7","xr-development","Use when building VR\u002FAR\u002FXR applications — OpenXR setup, XROrigin3D, hand tracking, controllers, passthrough, and Meta Quest deployment in Godot 4.3+","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fxr-development\u002FSKILL.md",[],[98,99,35,100,26,101,102,103,104,105,106,29,107,108,109],"xr development","development","deployment","vr","setup","tracking","godot 4","ar","hand","Meta","applications","quest",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":36},"01M6KRF8GZTG1TAS506MFBSGFC","web-services","Use when a Godot game calls a web server — HTTPRequest, downloads, REST\u002FJSON APIs, auth headers, WebSocketPeer clients, TLS, retries, and keeping secrets out of the build. Not for game networking\u002FRPCs (multiplayer-basics) or browser export (web-export)","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-services\u002FSKILL.md",[],[117,118,119,120,121,122,123,124,29,35,26,125,126,127,128,129,130],"web services","web","services","tls","retries","calling","auth","downloads","clients","headers","secrets","json","build","REST",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":142,"publishedAt":36},"01M6KRF38Q4WSKAYFS56PG87T0","web-export","Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",[137],{"categoryNo":138,"categoryName":139,"taxonomyType":140,"taxonomyTypeDesc":141},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[118,143,144,145,146,147,148,149,126,150,151,35,152,153,154,155,156,157,29,158,159,160],"export","web export","threads","limits","shipping","size","options","hosting","input","Coop","preset","browser","game","io","load","pwa","Audio","server",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":171,"publishedAt":36},"01M6KREYFETEBH62ZTN6EZH2X3","using-godot-prompter","Bootstrap skill — establishes how to find and use GodotPrompter skills, with platform-specific tool mapping","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fusing-godot-prompter\u002FSKILL.md",[167,170],{"categoryNo":168,"categoryName":169,"taxonomyType":140,"taxonomyTypeDesc":141},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[26,172,173,174,175,29,176,177,178,179,180],"using godot prompter","find","with","bootstrap","tool","platform","mapping","how","how to",{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":36},"01M6KRER5G7EQWKGAFN8QJKQ69","tween-animation","Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI\u002Fgameplay motion recipes","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Ftween-animation\u002FSKILL.md",[],[188,189,29,190,191,192,193,25,194,195,196,35,197],"tween animation","Animation","motion","parallel","gameplay","chaining","recipes","common","implementing","sequences",{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":204,"publishedAt":36},"01M6KREKGCQMVDV8WX7HWX8BZG","state-machine","Use when building a state machine or refactoring logic into one — enum, node, and resource-based FSM patterns with trade-offs. Not for adding states to an existing one","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[205,206,207,26,35,33,208,209,210,211,174,29,196,212],"state","state machine","machine","node","fsm","state machines","trade","trade-offs"]