summaryrefslogtreecommitdiff
path: root/scenes/microgames/ad/ad_window.gd
diff options
context:
space:
mode:
authorZoey Kitt <zoey.kitt@outlook.com>2024-11-16 11:47:54 -0600
committerZoey Kitt <zoey.kitt@outlook.com>2024-11-16 11:47:54 -0600
commit9eaa524fba7b110e609589c90cb27b033bdc5ecb (patch)
tree92a528abc5c128da157a7837ca34020112947c86 /scenes/microgames/ad/ad_window.gd
parent99f3bb77b916ac076bdfbb27a78299990290ee1e (diff)
The ad scales yay
Diffstat (limited to 'scenes/microgames/ad/ad_window.gd')
-rw-r--r--scenes/microgames/ad/ad_window.gd16
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.