Skip to content

Commit 1d36f9b

Browse files
committed
Assets museum: Add labels to height lines
1 parent bba406a commit 1d36f9b

File tree

3 files changed

+102
-1
lines changed

3 files changed

+102
-1
lines changed

scenes/game_elements/components/elements_scale_museum.tscn

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=10 format=3 uid="uid://cm88m1ynn3mp0"]
1+
[gd_scene load_steps=11 format=3 uid="uid://cm88m1ynn3mp0"]
22

33
[ext_resource type="Texture2D" uid="uid://caajyl18koevp" path="res://scenes/game_elements/props/decoration/hiding_mushroom/components/Mushroom_Idle.png" id="2_gqoln"]
44
[ext_resource type="Texture2D" uid="uid://b65dg7i548oip" path="res://scenes/game_elements/props/decoration/books/components/Books_1.png" id="2_jwcoy"]
@@ -10,6 +10,19 @@
1010
[ext_resource type="Texture2D" uid="uid://dyf1kgdf0ovtj" path="res://scenes/game_elements/props/buildings/house/components/House_Patch_Blue_01.png" id="8_f4mxb"]
1111
[ext_resource type="Texture2D" uid="uid://dc4nuj702f442" path="res://scenes/game_elements/props/tree/components/Tree_Patches_Green.png" id="9_hjmsw"]
1212

13+
[sub_resource type="GDScript" id="GDScript_hjmsw"]
14+
script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
15+
# SPDX-License-Identifier: MPL-2.0
16+
@tool
17+
extends Node2D
18+
19+
@onready var node: Node2D = $\"../..\"
20+
@onready var label: Label = $\"..\"
21+
22+
func _ready() -> void:
23+
label.text = \"%d\" % int(abs(node.position.y))
24+
"
25+
1326
[node name="ElementsScaleMuseum" type="Node2D"]
1427
metadata/_edit_horizontal_guides_ = [-43.0, -46.0, -56.0, -81.0, -86.0, -99.0, -129.0, -187.0]
1528

@@ -24,6 +37,16 @@ points = PackedVector2Array(0, 0, 750, 0)
2437
width = 1.0
2538
default_color = Color(0.2509804, 0.627451, 0.44313726, 1)
2639

40+
[node name="Label" type="Label" parent="Lines/Line2D9"]
41+
z_index = 100
42+
offset_top = -5.0
43+
offset_right = 40.0
44+
offset_bottom = 18.0
45+
text = "186"
46+
47+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D9/Label"]
48+
script = SubResource("GDScript_hjmsw")
49+
2750
[node name="Line2D8" type="Line2D" parent="Lines"]
2851
position = Vector2(0, -128.5)
2952
points = PackedVector2Array(0, 0, 601, 0)
@@ -36,42 +59,118 @@ points = PackedVector2Array(0, 0, 515, 0)
3659
width = 1.0
3760
default_color = Color(0.87058824, 0.34509805, 0.4745098, 1)
3861

62+
[node name="Label" type="Label" parent="Lines/Line2D7"]
63+
z_index = 100
64+
offset_top = -5.0
65+
offset_right = 40.0
66+
offset_bottom = 18.0
67+
text = "128"
68+
69+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D7/Label"]
70+
script = SubResource("GDScript_hjmsw")
71+
3972
[node name="Line2D6" type="Line2D" parent="Lines"]
4073
position = Vector2(0, -98.5)
4174
points = PackedVector2Array(0, 0, 399, 0)
4275
width = 1.0
4376
default_color = Color(0.49411765, 0.4392157, 0.73333335, 1)
4477

78+
[node name="Label" type="Label" parent="Lines/Line2D6"]
79+
z_index = 100
80+
offset_left = 26.0
81+
offset_top = -5.0
82+
offset_right = 66.0
83+
offset_bottom = 18.0
84+
text = "98"
85+
86+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D6/Label"]
87+
script = SubResource("GDScript_hjmsw")
88+
4589
[node name="Line2D5" type="Line2D" parent="Lines"]
4690
position = Vector2(0, -85.5)
4791
points = PackedVector2Array(0, 0, 336, 0)
4892
width = 1.0
4993
default_color = Color(0.19607843, 0.43137255, 0.4745098, 1)
5094

95+
[node name="Label" type="Label" parent="Lines/Line2D5"]
96+
z_index = 100
97+
offset_left = 3.0
98+
offset_top = -5.0
99+
offset_right = 43.0
100+
offset_bottom = 18.0
101+
text = "85"
102+
103+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D5/Label"]
104+
script = SubResource("GDScript_hjmsw")
105+
51106
[node name="Line2D4" type="Line2D" parent="Lines"]
52107
position = Vector2(0, -80.5)
53108
points = PackedVector2Array(0, 0, 249, 0)
54109
width = 1.0
55110
default_color = Color(0.90588236, 0.38039216, 0.38039216, 1)
56111

112+
[node name="Label" type="Label" parent="Lines/Line2D4"]
113+
z_index = 100
114+
offset_left = -24.0
115+
offset_top = -5.0
116+
offset_right = 16.0
117+
offset_bottom = 18.0
118+
text = "80"
119+
120+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D4/Label"]
121+
script = SubResource("GDScript_hjmsw")
122+
57123
[node name="Line2D3" type="Line2D" parent="Lines"]
58124
position = Vector2(0, -55.5)
59125
points = PackedVector2Array(0, 0, 174, 0)
60126
width = 1.0
61127
default_color = Color(0.2509804, 0.627451, 0.44313726, 1)
62128

129+
[node name="Label" type="Label" parent="Lines/Line2D3"]
130+
z_index = 100
131+
offset_left = 26.0
132+
offset_top = -5.0
133+
offset_right = 66.0
134+
offset_bottom = 18.0
135+
text = "55"
136+
137+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D3/Label"]
138+
script = SubResource("GDScript_hjmsw")
139+
63140
[node name="Line2D2" type="Line2D" parent="Lines"]
64141
position = Vector2(0, -45.5)
65142
points = PackedVector2Array(0, 0, 126, 0)
66143
width = 1.0
67144
default_color = Color(0.87058824, 0.34509805, 0.4745098, 1)
68145

146+
[node name="Label" type="Label" parent="Lines/Line2D2"]
147+
z_index = 100
148+
offset_left = 2.0
149+
offset_top = -5.0
150+
offset_right = 42.0
151+
offset_bottom = 18.0
152+
text = "45"
153+
154+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D2/Label"]
155+
script = SubResource("GDScript_hjmsw")
156+
69157
[node name="Line2D" type="Line2D" parent="Lines"]
70158
position = Vector2(0, -42.5)
71159
points = PackedVector2Array(0, 0, 71, 0)
72160
width = 1.0
73161
default_color = Color(0.827451, 0.28627452, 0.28627452, 1)
74162

163+
[node name="Label" type="Label" parent="Lines/Line2D"]
164+
z_index = 100
165+
offset_left = -24.0
166+
offset_top = -5.0
167+
offset_right = 16.0
168+
offset_bottom = 18.0
169+
text = "42"
170+
171+
[node name="ParentHeightLabel" type="Node2D" parent="Lines/Line2D/Label"]
172+
script = SubResource("GDScript_hjmsw")
173+
75174
[node name="Assets" type="Node2D" parent="."]
76175

77176
[node name="MushroomIdle" type="Sprite2D" parent="Assets"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends Node2D
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://bt3ejniktdn3m

0 commit comments

Comments
 (0)