Pulse Works Studio
Parse Error: Static function "get_window_size()" not found in base "OS".
Window size is no longer an OS method. DisplayServer.window_get_size() is the replacement.
Cause
Godot 4 moved window and screen queries to DisplayServer. Calling the old static method on OS produces this parse error because the analyzer can see OS and can see that the function is not on it.
Fix
func window_center() -> Vector2i:
var size := DisplayServer.window_get_size()
return size / 2
func cover_window(canvas: CanvasLayer) -> void:
var size := DisplayServer.window_get_size()
canvas.offset = Vector2(size)
Related
Godot Dev Tools is a Pulse Works Studio project. All error explainers.