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
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.