From 9eaa524fba7b110e609589c90cb27b033bdc5ecb Mon Sep 17 00:00:00 2001 From: Zoey Kitt Date: Sat, 16 Nov 2024 11:47:54 -0600 Subject: The ad scales yay --- scenes/microgames/ad/ad_window.gd | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scenes/microgames/ad/ad_window.gd') diff --git a/scenes/microgames/ad/ad_window.gd b/scenes/microgames/ad/ad_window.gd index 2662642..b35b200 100644 --- a/scenes/microgames/ad/ad_window.gd +++ b/scenes/microgames/ad/ad_window.gd @@ -6,7 +6,21 @@ extends "res://scenes/microgames/microgame_window.gd" # Called when the node enters the scene tree for the first time. func _ready() -> void: - pass # Replace with function body. + # Stretch the funny image to fit in the window + var window_size = get_viewport().size + var sprite := $Sprite2D + ## Scale!? + sprite.scale = Vector2( + float(window_size.x) / float(sprite.texture.get_width()), + float(window_size.y) / float(sprite.texture.get_height()) + ) + print(window_size) + print(Vector2(sprite.texture.get_width(), sprite.texture.get_height())) + print(sprite.scale) + print(Vector2( + float(window_size.x) / float(sprite.texture.get_width()), + float(window_size.y) / float(sprite.texture.get_height()) + )) # Called every frame. 'delta' is the elapsed time since the previous frame. -- cgit v1.2.3