diff options
Diffstat (limited to 'scenes/microgames/ad/ad_window.gd')
-rw-r--r-- | scenes/microgames/ad/ad_window.gd | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scenes/microgames/ad/ad_window.gd b/scenes/microgames/ad/ad_window.gd index 639ecd4..e397532 100644 --- a/scenes/microgames/ad/ad_window.gd +++ b/scenes/microgames/ad/ad_window.gd @@ -6,9 +6,14 @@ extends "res://scenes/microgames/microgame_window.gd" # Called when the node enters the scene tree for the first time. func _ready() -> void: + # Choose a random ad + var all_ads := $"All ads" + var sprite := all_ads.get_children().pick_random() as Sprite2D + sprite.centered = false + sprite.reparent(self) + # 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()), |