Scale Godot content for HiDPI
✓ Published0🌍 Public
Aadamscott
Last edited Feb 17, 2026
Created on Feb 17, 2026
This example demonstrates how to scale a Godot application’s content for HiDPI displays using the engine’s built-in scaling system. It shows a single line of GDScript that sets the root viewport’s `content_scale_factor` based on the display’s reported scale, retrieved via `DisplayServer.screen_get_scale()`. The code assigns this factor in the `_ready()` function of a `main.gd` script, ensuring the interface adapts to high-resolution screens without manual pixel calculations. The example relies on Godot’s `SceneTree` root and `DisplayServer` API, with no external libraries or data sources.
AI-generated description