![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Mentuhetep |
I am using this to set the game window to the top left corner of the screen:
OS.set_window_position(Vector2 (0,0))
However, the window appears a few pixels to the right. Playing around with it, I have found that a Vector2 (-7,0) will stick the window to the top left corner. Is there an offset? and if so, is it because the game is running in windowed mode?
I do not want to use fullscreen mode or maximize the window, though. Maybe there is a better way/method to achieve this?
Thanks for your attention!
I have been trying more stuff since I posted this question.
In borderless mode there are no issues whatsoever. Both OS.get_window_size() and OS.get_real_window_size() return the same value (as expected), and OS.set_window_position(Vector2(0,0)) sets the window at the top left corner perfectly.
In windowed mode, however, OS.get_window_size() and OS.get_real_window_size() return a difference of 18x47, that I assume corresponds to the frame of the window, and might vary in each OS and computer. However, in my case, the left and right frames of the window are only 1 pixel wide, which means there is a gap of 8 pixels when trying to position the window at (0,0).
My question will be, is this something intended by Godot or calculated by the OS? Does this extra framing gap is fixed, or changes with a different OS / different computer?
Mentuhetep | 2019-08-05 07:19