Title changing with window size

Godot Version

4.6.2

Question

I am working on a title screen for my game, but the title screen’s location changes with the window size. Is there any way to fix this? My title screen is a sprite2d if this is needed, I also have some code that should set it to a fixed location, but it doesn’t.

extends Sprite2D

var fixed_position = Vector2(954, 202)

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	global_position = fixed_position

Take a look here — you might find something useful:

I will take a look at it, thank you!

I took a look at it, and it didn’t really help with what I’m trying to do. I want the title to be locked at a location, and it isn’t.

As you can see, the size of the panels changes depending on the screen size. Based on this, you can set a fixed position for any node.

That is what im trying to, but i don’t know how to do it yet.

I have got it to work, I added a canvas layer and change the sprite2d into a texturerect. then i made the texture rect a child of the canvas layer. I then made the texture rect’s stretch mode to keep aspect centered.

Your solution is a hack. Godot controls do exactly what you need them to.

Thank you for the information, I will try to impliment that