Skip to content

Readd a method to center window (lost during DisplayServer refactoring) #5232

Closed
godotengine/godot
#81012
@ztc0611

Description

Describe the project you are working on

Works for every project type.

Describe the problem or limitation you are having in your project

In Godot 3.x, there was OS.center_window(). Godot 4.0 does not have any equivalent function as far as I can find, but obviously still has the ability to center the window as when the project is run initially it is centered.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

This restores the functionality already found in Godot 3.x.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Running this function will place the window in the center of the screen.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can be, but the function already existed in Godot 3.x.

Is there a reason why this should be core and not an add-on in the asset library?

Functionality existed in Godot 3.x.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions