Skip to content

Commit 57a1b31

Browse files
committed
Mention Default Theme Scale project setting in Multiple Resolutions
- Update advice on hiDPI support for 4.4 and later.
1 parent bdeab14 commit 57a1b31

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

tutorials/rendering/multiple_resolutions.rst

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ To configure the stretch scale at runtime from a script, use the
286286
``get_tree().root.content_scale_factor`` property (see
287287
:ref:`Window.content_scale_factor <class_Window_property_content_scale_factor>`).
288288

289+
You can also adjust the scale at which the default project theme is generated
290+
using the **GUI > Theme > Default Theme Scale** project setting. This can be
291+
used to create more logically-sized UIs at base resolutions that are
292+
significantly higher or lower than the default. However, this project setting
293+
cannot be changed at runtime, as its value is only read once when the project starts.
294+
289295
.. _doc_multiple_resolutions_stretch_scale_mode:
290296

291297
Stretch Scale Mode
@@ -370,10 +376,14 @@ Desktop game
370376
- Alternatively, if you're targeting high-end devices primarily, set the base
371377
window width to ``3840`` and window height to ``2160``.
372378
This allows you to provide higher resolution 2D assets, resulting in crisper
373-
visuals at the cost of higher memory usage and file sizes.
374-
Note that this will make non-mipmapped textures grainy on low resolution devices,
375-
so make sure to follow the instructions described in
376-
:ref:`doc_multiple_resolutions_reducing_aliasing_on_downsampling`.
379+
visuals at the cost of higher memory usage and file sizes. You'll also want
380+
to increase **GUI > Theme > Default Theme Scale** to a value between ``2.0``
381+
and ``3.0`` to ensure UI elements remain readable.
382+
383+
- Note that this will make non-mipmapped textures grainy on low resolution devices,
384+
so make sure to follow the instructions described in
385+
:ref:`doc_multiple_resolutions_reducing_aliasing_on_downsampling`.
386+
377387
- Set the stretch mode to ``canvas_items``.
378388
- Set the stretch aspect to ``expand``. This allows for supporting multiple aspect ratios
379389
and makes better use of tall smartphone displays (such as 18:9 or 19:9 aspect ratios).
@@ -419,10 +429,14 @@ to change the display orientation project setting.
419429
This allows you to provide higher resolution 2D assets, resulting in crisper
420430
visuals at the cost of higher memory usage and file sizes. Many devices have
421431
even higher resolution displays (1440p), but the difference with 1080p is
422-
barely visible given the small size of smartphone displays.
423-
Note that this will make non-mipmapped textures grainy on low resolution devices,
424-
so make sure to follow the instructions described in
425-
:ref:`doc_multiple_resolutions_reducing_aliasing_on_downsampling`.
432+
barely visible given the small size of smartphone displays. You'll also want
433+
to increase **GUI > Theme > Default Theme Scale** to a value between ``1.5``
434+
and ``2.0`` to ensure UI elements remain readable.
435+
436+
- Note that this will make non-mipmapped textures grainy on low resolution devices,
437+
so make sure to follow the instructions described in
438+
:ref:`doc_multiple_resolutions_reducing_aliasing_on_downsampling`.
439+
426440
- Set the stretch mode to ``canvas_items``.
427441
- Set the stretch aspect to ``expand``. This allows for supporting multiple aspect ratios
428442
and makes better use of tall smartphone displays (such as 18:9 or 19:9 aspect ratios).
@@ -445,10 +459,14 @@ Mobile game in portrait mode
445459
This allows you to provide higher resolution 2D assets, resulting in crisper
446460
visuals at the cost of higher memory usage and file sizes. Many devices have
447461
even higher resolution displays (1440p), but the difference with 1080p is
448-
barely visible given the small size of smartphone displays.
449-
Note that this will make non-mipmapped textures grainy on low resolution devices,
450-
so make sure to follow the instructions described in
451-
:ref:`doc_multiple_resolutions_reducing_aliasing_on_downsampling`.
462+
barely visible given the small size of smartphone displays. You'll also want
463+
to increase **GUI > Theme > Default Theme Scale** to a value between ``1.5``
464+
and ``2.0`` to ensure UI elements remain readable.
465+
466+
- Note that this will make non-mipmapped textures grainy on low resolution devices,
467+
so make sure to follow the instructions described in
468+
:ref:`doc_multiple_resolutions_reducing_aliasing_on_downsampling`.
469+
452470
- Set **Display > Window > Handheld > Orientation** to ``portrait``.
453471
- Set the stretch mode to ``canvas_items``.
454472
- Set the stretch aspect to ``expand``. This allows for supporting multiple aspect ratios
@@ -474,22 +492,16 @@ Non-game application
474492
- You can define a minimum window size by calling ``get_window().set_min_size()`` in a
475493
script's ``_ready()`` function. This prevents the user from resizing the application
476494
below a certain size, which could break the UI layout.
477-
478-
.. UPDATE: Planned feature. When manually override the 2D scale factor is supported,
479-
.. update this note.
480-
481-
.. note::
482-
483-
Godot doesn't support manually overriding the 2D scale factor yet, so it is
484-
not possible to have hiDPI support in non-game applications. Due to this, it
485-
is recommended to leave **Allow Hidpi** disabled in non-game applications to
486-
allow for the OS to use its low-DPI fallback.
495+
- Add a setting in the application's settings to change the root viewport's
496+
:ref:`stretch scale <doc_multiple_resolutions_stretch_scale>`,
497+
so that the UI can be made larger to account for hiDPI displays.
498+
See also the section on hiDPI support below.
487499

488500
hiDPI support
489501
-------------
490502

491503
By default, Godot projects are considered DPI-aware by the operating system.
492-
This is controlled by the **Display > Window > Dpi > Allow Hidpi** project setting,
504+
This is controlled by the **Display > Window > DPI > Allow hiDPI** project setting,
493505
which should be left enabled whenever possible. Disabling DPI awareness can break
494506
fullscreen behavior on Windows.
495507

@@ -508,19 +520,19 @@ To ensure 2D elements don't appear too small on hiDPI displays:
508520
stretch scale to a value corresponding to the display scale factor in an
509521
:ref:`autoload <doc_singletons_autoload>`'s ``_ready()`` function.
510522
The display scale factor is set in the operating system's settings and can be queried
511-
using :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>`. This
512-
method is currently only implemented on macOS. On other operating systems, you
513-
will need to implement a method to guess the display scale factor based on the
514-
screen resolution (with a setting to let the user override this if needed). This
515-
is the approach currently used by the Godot editor.
523+
using :ref:`screen_get_scale <class_DisplayServer_method_screen_get_scale>`. This
524+
method is currently implemented on Android, iOS, Linux (Wayland only), macOS and Web.
525+
On other platforms, you'll have to implement a method to guess the display
526+
scale factor based on the screen resolution (with a setting to let the
527+
user override this if needed). This is the approach currently used by the Godot editor.
516528

517-
The **Allow Hidpi** setting is only effective on Windows and macOS. It's ignored
529+
The **Allow hiDPI** setting is only effective on Windows and macOS. It's ignored
518530
on all other platforms.
519531

520532
.. note::
521533

522534
The Godot editor itself is always marked as DPI-aware. Running the project
523-
from the editor will only be DPI-aware if **Allow Hidpi** is enabled in the
535+
from the editor will only be DPI-aware if **Allow hiDPI** is enabled in the
524536
Project Settings.
525537

526538
.. _doc_multiple_resolutions_reducing_aliasing_on_downsampling:

0 commit comments

Comments
 (0)