summaryrefslogtreecommitdiff
path: root/scenes
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
parent99f3bb77b916ac076bdfbb27a78299990290ee1e (diff)
The ad scales yay
Diffstat (limited to 'scenes')
-rw-r--r--scenes/main.gd3
-rw-r--r--scenes/microgames/ad/ad_window.gd16
-rw-r--r--scenes/microgames/ad/ad_window.tscn12
3 files changed, 21 insertions, 10 deletions
diff --git a/scenes/main.gd b/scenes/main.gd
index 471d0c6..e9537d8 100644
--- a/scenes/main.gd
+++ b/scenes/main.gd
@@ -18,9 +18,6 @@ func _on_microgame_spawn_timer_timeout() -> void:
var window_scene = preload("res://scenes/microgames/ad/ad_window.tscn")
var window_instance = window_scene.instantiate()
add_child(window_instance)
- var microgame_scene = preload("res://scenes/microgames/ad/ad.tscn")
- var microgame_instance = microgame_scene.instantiate()
- window_instance.add_child(microgame_instance)
# Randomize window position
var screen_size = DisplayServer.screen_get_size()
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.
diff --git a/scenes/microgames/ad/ad_window.tscn b/scenes/microgames/ad/ad_window.tscn
index 9c70050..746c214 100644
--- a/scenes/microgames/ad/ad_window.tscn
+++ b/scenes/microgames/ad/ad_window.tscn
@@ -2,13 +2,13 @@
[ext_resource type="PackedScene" uid="uid://b2awdq32lxnef" path="res://scenes/microgames/microgame_window.tscn" id="1_gtv65"]
[ext_resource type="Script" path="res://scenes/microgames/ad/ad_window.gd" id="2_h3lwj"]
-[ext_resource type="PackedScene" uid="uid://dekqkxftnx3gd" path="res://scenes/microgames/ad/ad.tscn" id="3_j4tnf"]
+[ext_resource type="Texture2D" uid="uid://cpmvcepbd43p4" path="res://scenes/microgames/ad/ad_images/metaverse.png" id="4_gakxr"]
[node name="Window" instance=ExtResource("1_gtv65")]
-size = Vector2i(1024, 864)
-content_scale_size = Vector2i(1024, 1024)
-content_scale_mode = 0
-content_scale_factor = 0.58
+size = Vector2i(824, 604)
+content_scale_size = Vector2i(0, 0)
script = ExtResource("2_h3lwj")
-[node name="Ad" parent="." index="0" instance=ExtResource("3_j4tnf")]
+[node name="Sprite2D" type="Sprite2D" parent="." index="0"]
+texture = ExtResource("4_gakxr")
+centered = false