Set Window Size manually in GDScript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

Is there a way to do this So that for example i can click a button and the window size goes from say 480p to 720p without needing for people to Manually resize the window?

:bust_in_silhouette: Reply From: Bojidar Marinov

You should use OS::set_window_size for this.
E.g.

func _ready():
    get_node("480p_button").connect("pressed", self, "resize_to_480p")

func resize_to_480p():
    OS.set_window_size(Vector2(640, 480))

Alright, thanks for the help ^^

The_Duskitty | 2016-02-24 21:38