Hi,
Started using Godot for my next project, yay! Loving it very much.
1) Why can't the IDE keep its size and position? It always defaults to full screen. I tend to keep the editor to the left and have the docs open to the right.
2) I have a 4k monitor (plus 2nd monitor attached with different dpi) and when you run a project from the IDE, with hidpi off, it ends up by default in a weird location, usually in the lower right had part of the screen. If I enable hidpi for the project, it centered as expected, but the window is super tiny. My main display is 4k with 150% scaling (so I can actually see stuff, LOL).
3) I could not find a way in the setting to make the window center and scale using the OS scale factor the way I desire so I wrote this code. Does is seem sound? I'm only targeting desktop at the moment and it seems to work ok for me. Maybe someone can test it and we can improve it if necessary. It's my first draft:
func _ready() -> void:
WindowScaleDPI()
func MulDiv(aNumber: int, aNumerator: int, aDenominator: int) -> float:
if aDenominator == 0:
return -1.0
else:
var LValue: float = (aNumber * aNumerator)/aDenominator
if LValue >= 0:
return floor(LValue + 0.5)
else:
return floor(LValue - 0.5)
func WindowScaleDPI(aDefaultDPI: int = 96):
var size: Vector2 = OS.window_size
var dpi: int = OS.get_screen_dpi()
var scale_size: Vector2 = Vector2(MulDiv(size.x, dpi, aDefaultDPI), MulDiv(size.y, dpi, aDefaultDPI))
OS.window_size = scale_size
OS.center_window()
Thanks,
Jarrod