Quick answer: Use the Layout dropdown in the editor (Top Right, Bottom Wide, Center, etc.) to set anchors + offsets together. For dynamic layouts, parent Controls under HBoxContainer / VBoxContainer / GridContainer.
Resize the window. Save button slides off the edge. Anchors weren’t set; only offsets, which interpret the parent at the original size.
The Symptom
UI elements drift or anchor incorrectly when window resizes. Editor preview at design size looks fine.
The Fix
Layout presets. Select the Control. In the editor toolbar, click Layout → Preset (e.g. Top Right). Anchors + offsets set together for that pattern.
Common patterns:
- Full Rect: stretches with parent.
- Center: centered, fixed size.
- Top Wide / Bottom Wide: full width, anchored top/bottom.
- HCenter Wide: wide centered (good for menu rows).
Containers for Auto-Layout
HBoxContainer:
size_flags_horizontal: Expand
separation: 10
Children:
Button1
Button2
Button3
Children auto-layout horizontally; anchors handled by the container.
Verifying
Resize the editor Game window. Layout should respond appropriately. If a Control sticks to one position, its anchors are in the wrong preset.
“Layout preset for absolute. Container for auto. Resize works.”
Related Issues
For Control mouse_filter, see mouse filter. For Theme stylebox, see stylebox.
Anchors plus offsets. Layout follows.