diff --git a/document.tscn b/document.tscn index 46dd8cb..741a672 100644 --- a/document.tscn +++ b/document.tscn @@ -1,658 +1,100 @@ -[gd_scene format=3 uid="uid://qs3uqv4jnev3"] +[gd_scene load_steps=7 format=3 uid="uid://qs3uqv4jnev3"] -[node name="Root" type="Node"] +[ext_resource type="Script" path="res://scripts/physics_drag.gd" id="1_i3q73"] +[ext_resource type="Script" path="res://scripts/document.gd" id="1_t74iv"] +[ext_resource type="Script" path="res://scripts/toggle_gravity.gd" id="3_loy23"] -[node name="Document" type="Node" parent="."] +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ok5r2"] -[node name="root-685" type="Control" parent="Document"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_55s8d"] +content_margin_left = 10.0 +content_margin_top = 10.0 +content_margin_right = 10.0 +content_margin_bottom = 10.0 +bg_color = Color(0, 0, 0, 0.458824) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_61mkw"] + +[node name="Root" type="Node2D"] +script = ExtResource("1_i3q73") + +[node name="Document" type="Node2D" parent="."] +script = ExtResource("1_t74iv") + +[node name="Floor" type="StaticBody2D" parent="."] +position = Vector2(0, 1080) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"] +shape = SubResource("WorldBoundaryShape2D_ok5r2") + +[node name="Control" type="Control" parent="."] layout_mode = 3 -anchors_preset = 0 -offset_right = 621.5 -offset_bottom = 646.0 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = 1920.0 +offset_bottom = 1080.0 +grow_horizontal = 2 +grow_vertical = 2 -[node name="body-903" type="Control" parent="Document/root-685"] -anchors_preset = 0 -offset_left = 5.0 -offset_top = 5.0 -offset_right = 621.5 -offset_bottom = 646.0 +[node name="PanelContainer" type="PanelContainer" parent="Control"] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -349.0 +offset_top = 10.0 +offset_right = -10.0 +offset_bottom = 287.0 +grow_horizontal = 0 +theme_override_styles/panel = SubResource("StyleBoxFlat_55s8d") -[node name="h1-864" type="Control" parent="Document/root-685/body-903"] -anchors_preset = 0 -offset_top = 20.0 -offset_right = 240.5 -offset_bottom = 62.0 +[node name="VBoxContainer" type="VBoxContainer" parent="Control/PanelContainer"] +layout_mode = 2 -[node name="TEXT-604" type="Label" parent="Document/root-685/body-903/h1-864"] -layout_mode = 0 -offset_right = 239.0 -offset_bottom = 42.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 30 -text = "World Wide Web" +[node name="Label" type="Label" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +text = "Godot Browser" +horizontal_alignment = 1 -[node name="INLINE-563" type="Control" parent="Document/root-685/body-903"] -anchors_preset = 0 -offset_top = 82.0 -offset_right = 183.5 -offset_bottom = 128.0 +[node name="HSeparator" type="HSeparator" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 -[node name="TEXT-924" type="Label" parent="Document/root-685/body-903/INLINE-563"] -layout_mode = 0 -offset_right = 304.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "The WorldWideWeb (W3) is a wide-area" +[node name="Label2" type="Label" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Address" -[node name="a-151" type="Label" parent="Document/root-685/body-903/INLINE-563"] -layout_mode = 0 -offset_left = 305.5 -offset_right = 399.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "hypermedia" +[node name="TextEdit" type="TextEdit" parent="Control/PanelContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 36) +layout_mode = 2 +text = "http://google.com" -[node name="TEXT-182" type="Label" parent="Document/root-685/body-903/INLINE-563"] -layout_mode = 0 -offset_left = 401.0 -offset_right = 963.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "information retrieval initiative aiming to give universal access to a large " +[node name="HSeparator2" type="HSeparator" parent="Control/PanelContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 15.185) +layout_mode = 2 -[node name="TEXT-297" type="Label" parent="Document/root-685/body-903/INLINE-563"] -layout_mode = 0 -offset_top = 23.0 -offset_right = 182.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "universe of documents." +[node name="Label3" type="Label" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Settings" -[node name="p-527" type="Control" parent="Document/root-685/body-903"] -anchors_preset = 0 -offset_top = 138.0 -offset_right = 616.5 -offset_bottom = 184.0 +[node name="CheckBox" type="CheckBox" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Enable Gravity" +script = ExtResource("3_loy23") -[node name="TEXT-587" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_right = 748.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "Everything there is online about W3 is linked directly or indirectly to this document, including an" +[node name="HSeparator3" type="HSeparator" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_styles/separator = SubResource("StyleBoxEmpty_61mkw") -[node name="a-34" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 749.5 -offset_right = 902.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "executive summary" +[node name="Button" type="Button" parent="Control/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Refresh" -[node name="TEXT-340" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 904.0 -offset_right = 954.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "of the " - -[node name="TEXT-529" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_top = 23.0 -offset_right = 59.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "project," - -[node name="a-202" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 60.5 -offset_top = 23.0 -offset_right = 152.5 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Mailing lists" - -[node name="TEXT-45" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 154.0 -offset_top = 23.0 -offset_right = 159.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-391" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 160.5 -offset_top = 23.0 -offset_right = 206.5 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Policy" - -[node name="TEXT-480" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 208.0 -offset_top = 23.0 -offset_right = 311.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = ", November's" - -[node name="a-867" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 312.5 -offset_top = 23.0 -offset_right = 382.5 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "W3 news" - -[node name="TEXT-749" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 384.0 -offset_top = 23.0 -offset_right = 389.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-39" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 390.5 -offset_top = 23.0 -offset_right = 608.5 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Frequently Asked Questions" - -[node name="TEXT-481" type="Label" parent="Document/root-685/body-903/p-527"] -layout_mode = 0 -offset_left = 610.0 -offset_top = 23.0 -offset_right = 615.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "." - -[node name="dl-693" type="Control" parent="Document/root-685/body-903"] -anchors_preset = 0 -offset_top = 204.0 -offset_right = 570.5 -offset_bottom = 641.0 - -[node name="dt-368" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_right = 139.5 -offset_bottom = 23.0 - -[node name="a-803" type="Label" parent="Document/root-685/body-903/dl-693/dt-368"] -layout_mode = 0 -offset_right = 138.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "What's out there?" - -[node name="dd-251" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 23.0 -offset_right = 570.5 -offset_bottom = 46.0 - -[node name="TEXT-648" type="Label" parent="Document/root-685/body-903/dl-693/dd-251"] -layout_mode = 0 -offset_right = 331.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "Pointers to the world's online information," - -[node name="a-790" type="Label" parent="Document/root-685/body-903/dl-693/dd-251"] -layout_mode = 0 -offset_left = 332.5 -offset_right = 396.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "subjects" - -[node name="TEXT-956" type="Label" parent="Document/root-685/body-903/dl-693/dd-251"] -layout_mode = 0 -offset_left = 398.0 -offset_right = 403.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-821" type="Label" parent="Document/root-685/body-903/dl-693/dd-251"] -layout_mode = 0 -offset_left = 404.5 -offset_right = 490.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "W3 servers" - -[node name="TEXT-65" type="Label" parent="Document/root-685/body-903/dl-693/dd-251"] -layout_mode = 0 -offset_left = 492.0 -offset_right = 529.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = ", etc." - -[node name="dt-660" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 46.0 -offset_right = 37.5 -offset_bottom = 69.0 - -[node name="a-615" type="Label" parent="Document/root-685/body-903/dl-693/dt-660"] -layout_mode = 0 -offset_right = 36.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Help" - -[node name="dd-487" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 69.0 -offset_right = 269.5 -offset_bottom = 92.0 - -[node name="TEXT-928" type="Label" parent="Document/root-685/body-903/dl-693/dd-487"] -layout_mode = 0 -offset_right = 228.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "on the browser you are using" - -[node name="dt-663" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 92.0 -offset_right = 144.5 -offset_bottom = 115.0 - -[node name="a-325" type="Label" parent="Document/root-685/body-903/dl-693/dt-663"] -layout_mode = 0 -offset_right = 143.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Software Products" - -[node name="dd-554" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 115.0 -offset_right = 104.0 -offset_bottom = 161.0 - -[node name="TEXT-601" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_right = 471.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "A list of W3 project components and their current state. (e.g." - -[node name="a-468" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 472.5 -offset_right = 553.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Line Mode" - -[node name="TEXT-293" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 555.0 -offset_right = 588.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = ",X11" - -[node name="a-271" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 589.5 -offset_right = 627.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Viola" - -[node name="TEXT-223" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 629.0 -offset_right = 634.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-315" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 635.5 -offset_right = 711.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "NeXTStep" - -[node name="TEXT-203" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 713.0 -offset_right = 718.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-216" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 719.5 -offset_right = 777.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Servers" - -[node name="TEXT-467" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 779.0 -offset_right = 784.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-611" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 785.5 -offset_right = 826.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Tools" - -[node name="TEXT-194" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 828.0 -offset_right = 833.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-69" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 834.5 -offset_right = 915.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Mail robot" - -[node name="TEXT-823" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 917.0 -offset_right = 922.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "," - -[node name="a-529" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 923.5 -offset_right = 924.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 - -[node name="a-76" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_top = 23.0 -offset_right = 55.0 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Library" - -[node name="TEXT-794" type="Label" parent="Document/root-685/body-903/dl-693/dd-554"] -layout_mode = 0 -offset_left = 56.5 -offset_top = 23.0 -offset_right = 62.5 -offset_bottom = 46.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = ")" - -[node name="dt-715" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 161.0 -offset_right = 74.5 -offset_bottom = 184.0 - -[node name="a-506" type="Label" parent="Document/root-685/body-903/dl-693/dt-715"] -layout_mode = 0 -offset_right = 73.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Technical" - -[node name="dd-794" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 184.0 -offset_right = 440.5 -offset_bottom = 207.0 - -[node name="TEXT-321" type="Label" parent="Document/root-685/body-903/dl-693/dd-794"] -layout_mode = 0 -offset_right = 399.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "Details of protocols, formats, program internals etc" - -[node name="dt-702" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 207.0 -offset_right = 99.5 -offset_bottom = 230.0 - -[node name="a-109" type="Label" parent="Document/root-685/body-903/dl-693/dt-702"] -layout_mode = 0 -offset_right = 98.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Bibliography" - -[node name="dd-615" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 230.0 -offset_right = 389.5 -offset_bottom = 253.0 - -[node name="TEXT-842" type="Label" parent="Document/root-685/body-903/dl-693/dd-615"] -layout_mode = 0 -offset_right = 348.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "Paper documentation on W3 and references." - -[node name="dt-153" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 253.0 -offset_right = 54.5 -offset_bottom = 276.0 - -[node name="a-969" type="Label" parent="Document/root-685/body-903/dl-693/dt-153"] -layout_mode = 0 -offset_right = 53.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "People" - -[node name="dd-652" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 276.0 -offset_right = 386.5 -offset_bottom = 299.0 - -[node name="TEXT-234" type="Label" parent="Document/root-685/body-903/dl-693/dd-652"] -layout_mode = 0 -offset_right = 345.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "A list of some people involved in the project." - -[node name="dt-723" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 299.0 -offset_right = 57.5 -offset_bottom = 322.0 - -[node name="a-888" type="Label" parent="Document/root-685/body-903/dl-693/dt-723"] -layout_mode = 0 -offset_right = 56.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "History" - -[node name="dd-315" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 322.0 -offset_right = 352.5 -offset_bottom = 345.0 - -[node name="TEXT-548" type="Label" parent="Document/root-685/body-903/dl-693/dd-315"] -layout_mode = 0 -offset_right = 311.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "A summary of the history of the project." - -[node name="dt-76" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 345.0 -offset_right = 127.0 -offset_bottom = 368.0 - -[node name="a-59" type="Label" parent="Document/root-685/body-903/dl-693/dt-76"] -layout_mode = 0 -offset_right = 116.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "How can I help" - -[node name="TEXT-830" type="Label" parent="Document/root-685/body-903/dl-693/dt-76"] -layout_mode = 0 -offset_left = 117.5 -offset_right = 125.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "?" - -[node name="dd-186" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 368.0 -offset_right = 332.5 -offset_bottom = 391.0 - -[node name="TEXT-389" type="Label" parent="Document/root-685/body-903/dl-693/dd-186"] -layout_mode = 0 -offset_right = 291.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "If you would like to support the web.." - -[node name="dt-644" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_top = 391.0 -offset_right = 100.5 -offset_bottom = 414.0 - -[node name="a-484" type="Label" parent="Document/root-685/body-903/dl-693/dt-644"] -layout_mode = 0 -offset_right = 99.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "Getting code" - -[node name="dd-372" type="Control" parent="Document/root-685/body-903/dl-693"] -anchors_preset = 0 -offset_left = 40.0 -offset_top = 414.0 -offset_right = 358.5 -offset_bottom = 437.0 - -[node name="TEXT-189" type="Label" parent="Document/root-685/body-903/dl-693/dd-372"] -layout_mode = 0 -offset_right = 153.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = "Getting the code by" - -[node name="a-817" type="Label" parent="Document/root-685/body-903/dl-693/dd-372"] -layout_mode = 0 -offset_left = 154.5 -offset_right = 278.5 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 1, 1) -theme_override_font_sizes/font_size = 16 -text = "anonymous FTP" - -[node name="TEXT-13" type="Label" parent="Document/root-685/body-903/dl-693/dd-372"] -layout_mode = 0 -offset_left = 280.0 -offset_right = 317.0 -offset_bottom = 23.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_font_sizes/font_size = 16 -text = ", etc." +[connection signal="pressed" from="Control/PanelContainer/VBoxContainer/Button" to="Document" method="on_refresh"] diff --git a/project.godot b/project.godot index 9eb93be..0216467 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,19 @@ config/features=PackedStringArray("4.3", "Forward Plus") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/stretch/mode="canvas_items" + +[physics] + +2d/default_gravity_vector=Vector2(0, 0) +2d/default_linear_damp=3.257 +2d/solver/solver_iterations=128 +2d/solver/contact_max_allowed_penetration=0.32 + [rendering] environment/defaults/default_clear_color=Color(1, 1, 1, 1) diff --git a/scripts/document.gd b/scripts/document.gd index b5c8846..391db3b 100644 --- a/scripts/document.gd +++ b/scripts/document.gd @@ -1,5 +1,4 @@ -@tool -extends EditorScript +extends Node2D func _create_block_node(block: Layout.BlockNode) -> Node: var box = Control.new() @@ -8,32 +7,46 @@ box.size = block.rect.size return box -func _create_text_fragment(parent: Node, fragment: Layout.TextFragment) -> Node: - var label = Label.new() - label.text = fragment.text - label.name = fragment.dom_node.tag_name + "-" + str(randi_range(0, 1000)) - label.position = fragment.rect.position - label.size = fragment.rect.size - +func _apply_label_style(label: Label, fragment: Layout.TextFragment): var style = fragment.dom_node.style label.set('theme_override_font_sizes/font_size', style.font_size) label.set('theme_override_colors/font_color', style.text_color) - parent.add_child(label, true) - label.set_owner(get_editor_interface().get_edited_scene_root()) - return label +func _create_text_fragment_with_rigid_body(parent: Node, fragment: Layout.TextFragment) -> Node: + var rigid_body = RigidBody2D.new() + rigid_body.name = fragment.dom_node.tag_name + "-" + str(randi_range(0, 1000)) + rigid_body.position = fragment.rect.position + rigid_body.input_pickable = true + + var shape = CollisionShape2D.new() + shape.shape = RectangleShape2D.new() + shape.shape.size = fragment.rect.size + shape.translate(fragment.rect.size / 2) + + var label = Label.new() + label.text = fragment.text + label.size = fragment.rect.size + _apply_label_style(label, fragment) + + rigid_body.add_child(label) + rigid_body.add_child(shape) + parent.add_child(rigid_body) + return rigid_body func _create_block(parent: Node, block: Layout.BlockNode): var box = _create_block_node(block) parent.add_child(box, true) - box.set_owner(get_editor_interface().get_edited_scene_root()) for block_child in block.block_children: _create_block(box, block_child) for text_fragment in block.text_fragments: - _create_text_fragment(box, text_fragment) + # _create_text_fragment(box, text_fragment) + _create_text_fragment_with_rigid_body(box, text_fragment) -func _run() -> void: +func on_refresh() -> void: + for child in get_children(): + remove_child(child) + var file = FileAccess.open("res://TheProject.html", FileAccess.READ); var source = file.get_as_text() @@ -41,7 +54,7 @@ var dom_tree = DOM.build_dom_tree(parser) var layout_tree = Layout.build_layout_tree(dom_tree) layout_tree.layout(1000) - layout_tree.debug_print() + _create_block(self, layout_tree) - var document_node = get_editor_interface().get_edited_scene_root().get_node('Document') - _create_block(document_node, layout_tree) +func _ready(): + on_refresh() diff --git a/scripts/physics_drag.gd b/scripts/physics_drag.gd new file mode 100644 index 0000000..ad035f5 --- /dev/null +++ b/scripts/physics_drag.gd @@ -0,0 +1,33 @@ +extends Node2D + +var selected_body: RigidBody2D = null +var drag_position: Vector2 = Vector2.ZERO + +func _on_mouse_down(event: InputEventMouseButton): + var space_state = get_world_2d().direct_space_state + var query = PhysicsPointQueryParameters2D.new() + query.position = event.position + var result = space_state.intersect_point(query) + + if len(result) > 0: + selected_body = result[0]['collider'] + drag_position = selected_body.global_transform.inverse() * event.position + +func _on_mouse_up(event: InputEventMouseButton): + selected_body = null + +func _process(delta: float): + if selected_body == null: + return + + var mouse_position = get_viewport().get_mouse_position() + var anchor_position = selected_body.global_transform * drag_position + var force = mouse_position - anchor_position + selected_body.apply_impulse(force, anchor_position - selected_body.global_position) + +func _input(event: InputEvent) -> void: + if event is InputEventMouseButton: + if event.is_pressed(): + _on_mouse_down(event as InputEventMouseButton) + else: + _on_mouse_up(event as InputEventMouseButton) diff --git a/scripts/style.gd b/scripts/style.gd index 4975b30..2fbba30 100644 --- a/scripts/style.gd +++ b/scripts/style.gd @@ -4,16 +4,17 @@ var style = Style.new() style.font_size = parent_style.font_size style.text_color = parent_style.text_color + # NOTE: Margin not inherited. return style static func apply_default_style_for_element(tag_name: String, parent_style: Style) -> Style: var style = _copy_style(parent_style) match tag_name: 'body': - style.margin_top = 5 - style.margin_bottom = 5 - style.margin_left = 5 - style.margin_right = 5 + style.margin_top = 10 + style.margin_bottom = 10 + style.margin_left = 10 + style.margin_right = 10 'h1': style.font_size = 30 style.margin_top = 20 diff --git a/scripts/toggle_gravity.gd b/scripts/toggle_gravity.gd new file mode 100644 index 0000000..7487637 --- /dev/null +++ b/scripts/toggle_gravity.gd @@ -0,0 +1,16 @@ +extends CheckBox + +func _wake_up_all(node: Node): + if node is RigidBody2D: + var body = node as RigidBody2D + body.apply_impulse(Vector2.ZERO) + for child in node.get_children(): + _wake_up_all(child) + +func _toggled(toggled_on: bool) -> void: + PhysicsServer2D.area_set_param( + get_world_2d().space, + PhysicsServer2D.AREA_PARAM_GRAVITY_VECTOR, + Vector2(0, 1 if toggled_on else 0), + ) + _wake_up_all(get_tree().root)