0 votes

When i play the project, the screen keep appear at the bottom of my computer. How to change it to the center

in Engine by (12 points)

I have honestly no idea what you mean. A screenshot and better explanation would be advisable.

The windows position, how do you center it at runtime?

1 Answer

0 votes

You could use

OS.window_position = Vector2(400,400)

to manually calculate the correct position.

By combining with OS.get_screen_size() you can to this automatic.

See also OS Test Demo or the code around here for more display property demo'

by (638 points)

Thanks, It Worked

Have you used only the position or did you calculate it based on screen size. Maybe add your final code as a comment?

Please mark the answer as such if applicable :-)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.