diff options
author | Zoey Kitt <zoey.kitt@outlook.com> | 2024-11-16 11:24:33 -0600 |
---|---|---|
committer | Zoey Kitt <zoey.kitt@outlook.com> | 2024-11-16 11:24:33 -0600 |
commit | 99f3bb77b916ac076bdfbb27a78299990290ee1e (patch) | |
tree | ba0aabbd72250fac4500e2cbbb126244ef579fad /scenes/microgames/ad/ad.gd | |
parent | 589b0604d4bb8535b133512621ad2f340dc57911 (diff) |
Attempt to scale the ad to the window (this commit is actually a stash)
Diffstat (limited to 'scenes/microgames/ad/ad.gd')
-rw-r--r-- | scenes/microgames/ad/ad.gd | 18 |
1 files changed, 18 insertions, 0 deletions
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 |