Fullscreen not scaling properly

Godot Version

4.6.2

Question

I’m having problems when scaling on fullscreen mode.

In window mode when I choose the resolutions there is no problem, it scales properly and perfectly.

But in fullscreen it is scaled to the corner.

The stretch Mode is set to viewport and the Aspect to keep.

func _on_option_button_item_selected(index: int) -> void:
	var key = resolution_option_button.get_item_text(index)
	if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED:
		get_window().set_size(resolutions[key])
		center_window()
	else:
		get_window().size = Vector2i(resolutions[key])
		print(get_window().size)


func center_window() -> void:
	var screen_center = DisplayServer.screen_get_position() + DisplayServer.screen_get_size() / 2
	var window_size = get_window().get_size_with_decorations()
	get_window().set_position(screen_center - window_size /2)
	

func _on_fullscreen_toggled(toggled: bool) -> void:
	if !toggled:
		DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
	else:
		DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)

By the way, the game has a pixeler shader. I’ve tried using “get_window().content_scale_size = resolutions[key]” but it breaks the shader, the pixeler effect stops working and the UI breaks (I have anchor to full rect)

Use the Fullscreen Exclusive mode.

Still the same

It doesn’t look the same. It looks like it’s now in the upper left-hand corner.

So what’s your scene tree look like? Please take a screenshot, don’t type it out.

Is there a Camera3D hidden in your Player?

No, even if I create a new scene and add a new camera it happens

Ok, let me rephrase. Where is the Camera3D in your scene?

In the level is in the player, but I don’t think it matters

Ok, well if you don’t think it matters then I’ll stop trying to help you.

I mean, the camera being in the player doesn’t cause the problem