diff options
Diffstat (limited to 'scenes/microgames/ad/ad_window.gd')
-rw-r--r-- | scenes/microgames/ad/ad_window.gd | 16 |
1 files changed, 15 insertions, 1 deletions
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. |