GUI strange behavior for windows fits screen

This is very strange story.
We need window fits screen. Display resolution in our project settings - 1400x960. But other devices have different screen resolutions, so we need correct size for gui nodes manually in code.

First of all, we use obvious solution:
node_size = 1400

But this not work. Node is smaller than screen (or bigger)!
Okay, what we do next?
node_size = render.get_window_width()
gui.set_size(node,node_size)

Not work too! :frowning:
What we doing wrong?

Hi @morgerion!

To get the window width, you can either call render.get_window_width() from within your render script (example) or add a window listener.

2 Likes

I found a solution here: Get real size of GUI node