mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Merge pull request #18 from Calinou/add-basic-hidpi-support
Implement basic hiDPI support
This commit is contained in:
commit
7afba7e6ce
@ -41,7 +41,12 @@ const MENU = [
|
|||||||
signal quit
|
signal quit
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
# Set a minimum window size to prevent UI elements from collapsing on each other.
|
# Upscale everything if the display requires it (crude hiDPI support).
|
||||||
|
# This prevents UI elements from being too small on hiDPI displays.
|
||||||
|
if OS.get_screen_dpi() >= 192 and OS.get_screen_size().x >= 2048:
|
||||||
|
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_DISABLED, SceneTree.STRETCH_ASPECT_IGNORE, Vector2(), 2)
|
||||||
|
|
||||||
|
# Set a minimum window size to prevent UI elements from collapsing on each other.
|
||||||
# This property is only available in 3.2alpha or later, so use `set()` to fail gracefully if it doesn't exist.
|
# This property is only available in 3.2alpha or later, so use `set()` to fail gracefully if it doesn't exist.
|
||||||
OS.set("min_window_size", Vector2(1024, 600))
|
OS.set("min_window_size", Vector2(1024, 600))
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ gdscript/warnings/unsafe_call_argument=true
|
|||||||
|
|
||||||
window/size/width=1280
|
window/size/width=1280
|
||||||
window/size/height=720
|
window/size/height=720
|
||||||
|
window/dpi/allow_hidpi=true
|
||||||
|
|
||||||
[logging]
|
[logging]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user