Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Lejardo |
I set Project-Window-Size 1600x900, looks pretty.
Then I reset Project-Window-Size 1024x600, also looks great.
But wirld things happend…
When I set Project-Window-Size 1600x900, and use code below changing it to 1024x600, it looks terrified, seems also resize all the label text together.
pics here:
This is “Using Project-Window-Size” set 1024x600, looks good:
This is "“Using Project-Window-Size” set 1600x900, then use script change to 1024x600, looks sad (label text automaticly scaled):
I’ve tried these codes, none can change project-window-size like pic1
OS.set_window_size(Vector2(1024,600))
get_viewport().set_size_override(true,Vector2(1024,600),Vector2(0,0))
$"/root".size=Vector2(1024,600)
So, how can I change window-size, like changing from Project-window-size effect, using code?
I find out there is “display/window/size/width”,“display/window/size/height” in Project-Window-Size, how can I change these vales using GDscript?
Have been confused for couple of days…
Thank God may somebody help me out…
Lejardo | 2018-10-20 15:19
It looks when using script “OS.set_window_size(Vector2(1024,600))” , it just scale the resolution which project-window-size set, to 1024x600, that is:
if Project-window-size set 1920x1080, then use script above, it just scale the 1920x1080 view to 1024x600, scale all the UI (button, text, etc…).
It looks very different to Project-window-size set 1024x600.
Lejardo | 2018-10-20 15:55