Loading...
Loading...
Expert blueprint for responsive UI layouts using Container nodes (HBoxContainer, VBoxContainer, GridContainer, MarginContainer, ScrollContainer). Covers size flags, anchors, split containers, and dynamic layouts. Use when building adaptive interfaces OR implementing responsive menus. Keywords Container, HBoxContainer, VBoxContainer, GridContainer, size_flags, EXPAND_FILL, anchors, responsive.
npx skill4agent add thedivergentai/gd-agentic-skills godot-ui-containerschild.position = Vector2(10, 10)custom_minimum_sizesize_flags_vertical = SIZE_EXPAND_FILLGridContainercolumns = 1columnsadd_theme_constant_override("separation", value)custom_minimum_size# VBoxContainer example
# Automatically stacks children vertically
# Children:
# Button ("Play")
# Button ("Settings")
# Button ("Quit")
# Set separation between items
$VBoxContainer.add_theme_constant_override("separation", 10)# Use anchors and size flags
func _ready() -> void:
# Expand to fill parent
$MarginContainer.set_anchors_preset(Control.PRESET_FULL_RECT)
# Add margins
$MarginContainer.add_theme_constant_override("margin_left", 20)
$MarginContainer.add_theme_constant_override("margin_right", 20)# Control how children expand in containers
button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
button.size_flags_vertical = Control.SIZE_SHRINK_CENTER