Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Covers Godot 4.3+ responsive UI: stretch modes, aspect ratios, DPI scaling, and mobile/desktop adaptation.
87% 100%+13 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 20 of 23 without it.
This test ran on v1. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
Related skills: godot-ui for Control node layout and themes, export-pipeline for platform-specific export settings, godot-project-setup for initial project resolution settings, input-handling for touch vs desktop input adaptation, localization for layout adjustments per locale, mobile-development for safe-area and notch handling.
Configure base resolution and stretch behaviour in Project > Project Settings > Display > Window.
Key settings and their keys in the [display] section of project.godot:
| Setting | project.godot key | Recommended value |
|---|---|---|
| Viewport width | window/size/viewport_width | 1920 (or your base design width) |
| Viewport height | window/size/viewport_height | 1080 (or your base design height) |
| Stretch mode | window/stretch/mode | canvas_items (most games) |
| Stretch aspect | window/stretch/aspect | expand (fill screen) or keep (letterbox) |
| Scale factor | window/stretch/scale | 1 |
| Scale mode | window/stretch/scale_mode | fractional; integer for pixel art |
Godot 4.7+: Projects newly created in Godot 4.7 already default
display/window/stretch/modetocanvas_itemsanddisplay/window/stretch/aspecttoexpand(previouslydisabled/keep) — the recommendations above are now the out-of-the-box values. Projects created on older versions are unchanged (the property default is stilldisabled), so set both explicitly when upgrading. See the 4.7 migration guide.
The engine reads these settings once at startup; changing them with ProjectSettings.set_setting() later has no effect. At runtime, set the matching Window properties instead:
GDScript:
# Read current viewport size
var viewport_size: Vector2 = get_viewport().get_visible_rect().size
# Change stretch mode at runtime (takes effect immediately)
get_window().content_scale_mode = Window.CONTENT_SCALE_MODE_CANVAS_ITEMS
C#:
Next to this one in the catalogue, plus more from the same author.