11[gd_scene format =3 uid ="uid://c6mikotrke4mc" ]
22
3- [ext_resource type ="Texture2D" uid ="uid://756pdnslep0q" path ="res://scenes/game_elements/fx/world_reweaven/components/string.png" id ="1_k0a1w" ]
43[ext_resource type ="PackedScene" uid ="uid://bs32ac1yj83ub" path ="res://scenes/game_elements/fx/spirograph/spirograph.tscn" id ="3_h26y6" ]
54[ext_resource type ="Script" uid ="uid://c4oww6rkbqfxc" path ="res://scenes/game_elements/fx/stitcher/components/stitcher.gd" id ="4_5l8d3" ]
65
76[sub_resource type ="GDScript" id ="GDScript_0e48y" ]
87script/source = "extends Node2D
98
9+ @onready var mouse_tracker : Node2D = % MouseTracker
1010@onready var spirograph_mouse : Spirograph = % SpirographMouse
11+ @onready var stitcher_mouse : Stitcher = % StitcherMouse
1112
1213func _process (_delta : float ) -> void :
1314 var mouse_pos := get_global_mouse_position ()
14- spirograph_mouse .global_position = lerp (spirograph_mouse .global_position , mouse_pos , 0.1 )
15- # var new_pos := spirograph_mouse.global_position.move_toward(mouse_pos, 5.0)
16- # new_pos = lerp(new_pos, mouse_pos, 0.1)
17- # spirograph_mouse.global_position = new_pos
15+ mouse_tracker .global_position = lerp (mouse_tracker .global_position , mouse_pos , 0.1 )
16+
17+ func _unhandled_input (event : InputEvent ) -> void :
18+ if event is not InputEventMouseButton :
19+ return
20+ if event .pressed :
21+ spirograph_mouse .process_mode = Node .PROCESS_MODE_DISABLED
22+ spirograph_mouse .visible = false
23+ stitcher_mouse .process_mode = Node .PROCESS_MODE_INHERIT
24+ stitcher_mouse .visible = true
25+ else :
26+ spirograph_mouse .process_mode = Node .PROCESS_MODE_INHERIT
27+ spirograph_mouse .visible = true
28+ stitcher_mouse .process_mode = Node .PROCESS_MODE_DISABLED
29+ stitcher_mouse .visible = false
1830"
1931
2032[sub_resource type ="Animation" id ="Animation_0hol4" ]
@@ -43,17 +55,16 @@ tracks/1/keys = {
4355"update" : 0 ,
4456"values" : [0.0 ]
4557}
46- tracks/2/type = "value "
58+ tracks/2/type = "bezier "
4759tracks/2/imported = false
4860tracks/2/enabled = true
49- tracks/2/path = NodePath ("StitchTest/Path2D/PathFollow2D:progress_ratio " )
61+ tracks/2/path = NodePath ("StitchTest/Path2D/PathFollow2D:progress " )
5062tracks/2/interp = 1
5163tracks/2/loop_wrap = true
5264tracks/2/keys = {
53- "times" : PackedFloat32Array (0 ),
54- "transitions" : PackedFloat32Array (1 ),
55- "update" : 0 ,
56- "values" : [0.0 ]
65+ "handle_modes" : PackedInt32Array (0 ),
66+ "points" : PackedFloat32Array (0 , -0.25 , 0 , 0.25 , 0 ),
67+ "times" : PackedFloat32Array (0 )
5768}
5869
5970[sub_resource type ="Animation" id ="Animation_epypp" ]
@@ -85,17 +96,16 @@ tracks/1/keys = {
8596"update" : 0 ,
8697"values" : [0.0 , 1.0 ]
8798}
88- tracks/2/type = "value "
99+ tracks/2/type = "bezier "
89100tracks/2/imported = false
90101tracks/2/enabled = true
91- tracks/2/path = NodePath ("StitchTest/Path2D/PathFollow2D:progress_ratio " )
102+ tracks/2/path = NodePath ("StitchTest/Path2D/PathFollow2D:progress " )
92103tracks/2/interp = 1
93104tracks/2/loop_wrap = true
94105tracks/2/keys = {
95- "times" : PackedFloat32Array (0 , 0.5 , 1.6 , 2.1 , 3.2 , 3.7 , 4.6 , 5.1 , 6 ),
96- "transitions" : PackedFloat32Array (1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ),
97- "update" : 0 ,
98- "values" : [0.0 , 0.26666668 , 0.26666668 , 0.53333336 , 0.53333336 , 0.76666665 , 0.76666665 , 1.0 , 1.0 ]
106+ "handle_modes" : PackedInt32Array (0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ),
107+ "points" : PackedFloat32Array (0 , -0.25 , 0 , 0.25 , 0 , 338.0688 , -0.25 , 0 , 0.25 , 0 , 338.0688 , -0.25 , 0 , 0.25 , 0 , 702.7635 , -0.25 , 0 , 0.25 , 0 , 702.7635 , -0.25 , 0 , 0.25 , 0 , 1070.8698 , -0.25 , 0 , 0.25 , 0 , 1070.8698 , -0.25 , 0 , 0.25 , 0 , 1441.0135 , -0.25 , 0 , 0.25 , 0 , 1441.0135 , -0.25 , 0 , 0.25 , 0 ),
108+ "times" : PackedFloat32Array (0 , 1.1261708 , 1.3764602 , 2.6011987 , 2.851488 , 4.152527 , 4.402816 , 5.7497106 , 6 )
99109}
100110
101111[sub_resource type ="AnimationLibrary" id ="AnimationLibrary_0hol4" ]
@@ -111,7 +121,7 @@ point_count = 3
111121
112122[sub_resource type ="Curve2D" id ="Curve2D_5l8d3" ]
113123_data = {
114- "points" : PackedVector2Array (0 , 0 , 0 , 0 , 505 , 108 , 0 , 0 , 0 , 0 , 856 , 407 , 0 , 0 , 0 , 0 , 492 , 693 , 0 , 0 , 0 , 0 , 210 , 398 , 0 , 0 , 0 , 0 , 505 , 108 )
124+ "points" : PackedVector2Array (0 , 0 , 0 , 0 , 555 , 253 , 0 , 0 , 0 , 0 , 856 , 407 , 0 , 0 , 0 , 0 , 532 , 571 , 0 , 0 , 0 , 0 , 210 , 398 , 0 , 0 , 0 , 0 , 555 , 253 )
115125}
116126point_count = 5
117127
@@ -132,29 +142,34 @@ autoplay = &"default"
132142
133143[node name ="Line2D" type ="Line2D" parent ="MouseTest" unique_id =1593087933 ]
134144texture_repeat = 2
135- position = Vector2 ( 3 , -1 )
145+ width = 3.0
136146width_curve = SubResource ("Curve_k0a1w" )
137- texture = ExtResource ("1_k0a1w" )
138- texture_mode = 2
139147joint_mode = 2
140148
141- [node name ="SpirographMouse" parent = "MouseTest" unique_id = 812965254 node_paths = PackedStringArray ( "line" ) instance = ExtResource ( "3_h26y6" ) ]
149+ [node name ="MouseTracker" type = "Node2D" parent = "MouseTest" unique_id = 1967144198 ]
142150unique_name_in_owner = true
143- position = Vector2 (742 , 340 )
144- line = NodePath ("../Line2D" )
151+
152+ [node name ="SpirographMouse" parent ="MouseTest/MouseTracker" unique_id =812965254 node_paths =PackedStringArray ("line" ) instance =ExtResource ("3_h26y6" )]
153+ unique_name_in_owner = true
154+ line = NodePath ("../../Line2D" )
145155radius = 44.0
146156max_vel = 100.0
147- radius_update = 0.03
148157debug = true
149158
159+ [node name ="StitcherMouse" type ="Node2D" parent ="MouseTest/MouseTracker" unique_id =782158258 node_paths =PackedStringArray ("line" )]
160+ unique_name_in_owner = true
161+ process_mode = 4
162+ script = ExtResource ("4_5l8d3" )
163+ line = NodePath ("../../Line2D" )
164+ stitches_per_second = 0.01
165+ metadata/_custom_type_script = "uid://c4oww6rkbqfxc"
166+
150167[node name ="SimpleTest" type ="Node2D" parent ="." unique_id =1650676841 ]
151168
152169[node name ="Line2D" type ="Line2D" parent ="SimpleTest" unique_id =625975575 ]
153170texture_repeat = 2
154- position = Vector2 ( 3 , -1 )
171+ width = 3.0
155172width_curve = SubResource ("Curve_k0a1w" )
156- texture = ExtResource ("1_k0a1w" )
157- texture_mode = 1
158173joint_mode = 2
159174
160175[node name ="Spirograph" parent ="SimpleTest" unique_id =1097706612 node_paths =PackedStringArray ("line" ) instance =ExtResource ("3_h26y6" )]
@@ -167,32 +182,34 @@ debug = true
167182
168183[node name ="Line2D" type ="Line2D" parent ="StitchTest" unique_id =214318953 ]
169184texture_repeat = 2
170- position = Vector2 (3 , -1 )
171- texture = ExtResource ("1_k0a1w" )
172- texture_mode = 1
185+ width = 3.0
186+ width_curve = SubResource ("Curve_k0a1w" )
173187joint_mode = 2
174188
175189[node name ="Path2D" type ="Path2D" parent ="StitchTest" unique_id =1459786898 ]
190+ position = Vector2 (393 , 118 )
176191curve = SubResource ("Curve2D_5l8d3" )
177192
178193[node name ="PathFollow2D" type ="PathFollow2D" parent ="StitchTest/Path2D" unique_id =1080902156 ]
179- position = Vector2 (505 , 108 )
194+ position = Vector2 (555 , 253 )
180195rotation = 0.70556813
181196rotates = false
182197
183198[node name ="Stitcher" type ="Node2D" parent ="StitchTest/Path2D/PathFollow2D" unique_id =1460959262 node_paths =PackedStringArray ("line" )]
184199script = ExtResource ("4_5l8d3" )
185200line = NodePath ("../../../Line2D" )
201+ stitches_per_second = 0.0
202+ direction_update = 0.09
203+ min_points_distance = 20
204+ max_points = 40
186205metadata/_custom_type_script = "uid://c4oww6rkbqfxc"
187206
188207[node name ="PathTest" type ="Node2D" parent ="." unique_id =1542033045 ]
189208
190209[node name ="Line2D" type ="Line2D" parent ="PathTest" unique_id =479563041 ]
191210texture_repeat = 2
192- position = Vector2 ( 3 , -1 )
211+ width = 3.0
193212width_curve = SubResource ("Curve_k0a1w" )
194- texture = ExtResource ("1_k0a1w" )
195- texture_mode = 1
196213joint_mode = 2
197214
198215[node name ="Path2D" type ="Path2D" parent ="PathTest" unique_id =452573456 ]
0 commit comments