How to get viewport width that is set in the project settings?

Godot Version

4.5.1

Question

I’m trying to adjust a game if the user changes the window size. So I’m trying to calculate the ratio between the current viewport width and the layout viewport width as set in the project settings. How do I get the latter?

You should be able to use ProjectSettings.get_setting("display/window/size/viewport_width")

1 Like

ProjectSettings.get_setting(“display/window/size/viewport_width”)

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.