So, I want to change the resolution of the game like any other game does. But I simply find any tutorial related on this and when I tried doing it my self, the whole canvas does not get stretched to the current res and the mouse gets mouse misalignment.
THIS IS AN EXAMPLE OF A GAME WHERE YOU CHANGE THE RESOLUTION:
Here the code that I have. I need help btw… Thanks for reading!
func _on_resolutions_item_selected(index: int) -> void:
var current_viewport_rid = get_viewport().get_viewport_rid()
match index:
0:
RenderingServer.viewport_set_size(current_viewport_rid, 1152, 648)
$Panel.size = Vector2(1152, 648)
1:
RenderingServer.viewport_set_size(current_viewport_rid, 1920, 1080)
$Panel.size = Vector2(1920, 1080)