From 99f3bb77b916ac076bdfbb27a78299990290ee1e Mon Sep 17 00:00:00 2001 From: Zoey Kitt Date: Sat, 16 Nov 2024 11:24:33 -0600 Subject: Attempt to scale the ad to the window (this commit is actually a stash) --- scenes/microgames/ad/ad.gd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scenes/microgames/ad/ad.gd (limited to 'scenes/microgames/ad/ad.gd') diff --git a/scenes/microgames/ad/ad.gd b/scenes/microgames/ad/ad.gd new file mode 100644 index 0000000..5a0a44a --- /dev/null +++ b/scenes/microgames/ad/ad.gd @@ -0,0 +1,18 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + # Stretch the funny image to fit in the window + const AD_WINDOW_SIZE = Vector2(1024, 1024) + var sprite := $Sprite2D + # Scale!? + sprite.scale = Vector2( + AD_WINDOW_SIZE.x / sprite.texture.get_width(), + AD_WINDOW_SIZE.y / sprite.texture.get_height() + ) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass -- cgit v1.2.3