-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode.tscn
41 lines (34 loc) · 1.27 KB
/
node.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[gd_scene load_steps=3 format=3 uid="uid://d0ebotx8kxlpp"]
[ext_resource type="Texture2D" uid="uid://wwm4eblvl7pu" path="res://millie-parfait.jpg" id="1_vvyy6"]
[sub_resource type="GDScript" id="GDScript_qvby6"]
script/source = "extends Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
print(\"default aspect ratio: %s\" % [GlobalWindow.aspectRatio])
GlobalWindow.resolution.connect(func(size: Vector2i):
var arr = [size.x, size.y, GlobalWindow._get_aspect_ratio(size)]
$Label.text = \"%s x %s | aspect ratio: %s\" % arr
print(\"width: %s height: %s aspect ratio: %s\" % arr)
)
"
[node name="Node" type="Node"]
script = SubResource("GDScript_qvby6")
[node name="Millie-parfait" type="Sprite2D" parent="."]
position = Vector2(960, 540)
scale = Vector2(1.5, 1.5)
texture = ExtResource("1_vvyy6")
[node name="Label" type="Label" parent="."]
anchors_preset = -1
anchor_left = 0.388021
anchor_top = 0.461574
anchor_right = 0.611979
anchor_bottom = 0.538426
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 20
theme_override_font_sizes/font_size = 60
text = "Width x Height"
horizontal_alignment = 1
vertical_alignment = 1
metadata/_edit_use_anchors_ = true