main.tscn 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. [gd_scene load_steps=15 format=3 uid="uid://6a0nxwkgf5dq"]
  2. [ext_resource type="Script" uid="uid://db4ofia8ieq55" path="res://utils/label_fps.gd" id="1"]
  3. [ext_resource type="Script" uid="uid://dustsplck84ac" path="res://utils/label_version.gd" id="2"]
  4. [ext_resource type="Script" uid="uid://c87b1snynit3u" path="res://utils/label_engine.gd" id="3"]
  5. [ext_resource type="Script" uid="uid://cw0pi4lgucxdr" path="res://tests_menu.gd" id="4"]
  6. [ext_resource type="Script" uid="uid://bjl0grl2gv43y" path="res://utils/label_test.gd" id="5"]
  7. [ext_resource type="Script" uid="uid://b4rnndt2dw5g1" path="res://utils/label_pause.gd" id="6"]
  8. [ext_resource type="Script" uid="uid://7kql0xtuc7ny" path="res://utils/ticks_per_second.gd" id="8_dg77c"]
  9. [ext_resource type="Script" uid="uid://beqnv31yip0bl" path="res://utils/time_scale.gd" id="9_ycdy4"]
  10. [ext_resource type="Script" uid="uid://k8crlob60yte" path="res://utils/container_log.gd" id="10"]
  11. [ext_resource type="Script" uid="uid://cvoeuonqmsye1" path="res://utils/max_steps_per_frame.gd" id="10_w48qg"]
  12. [ext_resource type="Script" uid="uid://b2t0e1okrl3j4" path="res://utils/scroll_log.gd" id="11"]
  13. [ext_resource type="Script" uid="uid://ijebwwx4t8et" path="res://utils/physics_interpolation.gd" id="11_ycdy4"]
  14. [ext_resource type="Script" uid="uid://db80201lynb6l" path="res://tests.gd" id="12"]
  15. [sub_resource type="StyleBoxFlat" id="1"]
  16. bg_color = Color(0, 0, 0, 0.176471)
  17. [node name="Main" type="Control"]
  18. layout_mode = 3
  19. anchors_preset = 15
  20. anchor_right = 1.0
  21. anchor_bottom = 1.0
  22. grow_horizontal = 2
  23. grow_vertical = 2
  24. mouse_filter = 2
  25. script = ExtResource("12")
  26. [node name="TestsMenu" type="MenuButton" parent="."]
  27. layout_mode = 0
  28. offset_left = 10.0
  29. offset_top = 10.0
  30. offset_right = 125.0
  31. offset_bottom = 30.0
  32. text = "Tests"
  33. flat = false
  34. script = ExtResource("4")
  35. [node name="LabelControls" type="Label" parent="."]
  36. layout_mode = 0
  37. offset_left = 157.0
  38. offset_top = 13.0
  39. offset_right = 646.0
  40. offset_bottom = 27.0
  41. theme_override_constants/outline_size = 4
  42. text = "P: Toggle Pause | R: Restart | C: Toggle Collision | F: Toggle Fullscreen | ESC: Quit"
  43. [node name="LabelFPS" type="Label" parent="."]
  44. layout_mode = 1
  45. anchors_preset = 2
  46. anchor_top = 1.0
  47. anchor_bottom = 1.0
  48. offset_left = 10.0
  49. offset_top = -36.0
  50. offset_right = 55.0
  51. offset_bottom = -13.0
  52. grow_vertical = 0
  53. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  54. theme_override_constants/outline_size = 4
  55. text = "FPS: 0"
  56. script = ExtResource("1")
  57. [node name="LabelEngine" type="Label" parent="."]
  58. layout_mode = 1
  59. anchors_preset = 2
  60. anchor_top = 1.0
  61. anchor_bottom = 1.0
  62. offset_left = 10.0
  63. offset_top = -64.0
  64. offset_right = 128.0
  65. offset_bottom = -41.0
  66. grow_vertical = 0
  67. theme_override_colors/font_color = Color(1, 1, 1, 0.752941)
  68. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  69. theme_override_constants/outline_size = 4
  70. text = "Physics engine:"
  71. script = ExtResource("3")
  72. [node name="LabelVersion" type="Label" parent="."]
  73. layout_mode = 1
  74. anchors_preset = 2
  75. anchor_top = 1.0
  76. anchor_bottom = 1.0
  77. offset_left = 10.0
  78. offset_top = -92.0
  79. offset_right = 125.0
  80. offset_bottom = -69.0
  81. grow_vertical = 0
  82. theme_override_colors/font_color = Color(1, 1, 1, 0.752941)
  83. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  84. theme_override_constants/outline_size = 4
  85. text = "Godot version:"
  86. script = ExtResource("2")
  87. [node name="LabelTest" type="Label" parent="."]
  88. layout_mode = 1
  89. anchors_preset = 2
  90. anchor_top = 1.0
  91. anchor_bottom = 1.0
  92. offset_left = 10.0
  93. offset_top = -120.0
  94. offset_right = 50.0
  95. offset_bottom = -97.0
  96. grow_vertical = 0
  97. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  98. theme_override_constants/outline_size = 4
  99. text = "Test:"
  100. script = ExtResource("5")
  101. [node name="LabelPause" type="Label" parent="."]
  102. modulate = Color(1, 1, 0, 1)
  103. layout_mode = 1
  104. anchors_preset = 5
  105. anchor_left = 0.5
  106. anchor_right = 0.5
  107. offset_left = -62.0
  108. offset_top = 48.0
  109. offset_right = 62.0
  110. offset_bottom = 96.0
  111. grow_horizontal = 2
  112. theme_override_constants/outline_size = 6
  113. theme_override_font_sizes/font_size = 24
  114. text = "Paused"
  115. script = ExtResource("6")
  116. [node name="Options" type="VBoxContainer" parent="."]
  117. layout_mode = 1
  118. anchors_preset = 1
  119. anchor_left = 1.0
  120. anchor_right = 1.0
  121. offset_left = -392.0
  122. offset_top = 56.0
  123. offset_right = -16.0
  124. offset_bottom = 168.0
  125. grow_horizontal = 0
  126. theme_override_constants/separation = 6
  127. [node name="TicksPerSecond" type="HBoxContainer" parent="Options"]
  128. layout_mode = 2
  129. tooltip_text = "Higher values make physics more precise at the cost of higher CPU utilization.
  130. Low values may result in objects phasing through each other (tunneling).
  131. Physics ticks per second are automatically multiplied by Time Scale in this project."
  132. theme_override_constants/separation = 10
  133. script = ExtResource("8_dg77c")
  134. [node name="Label" type="Label" parent="Options/TicksPerSecond"]
  135. custom_minimum_size = Vector2(164, 0)
  136. layout_mode = 2
  137. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  138. theme_override_constants/outline_size = 4
  139. text = "Ticks per Second"
  140. [node name="HSlider" type="HSlider" parent="Options/TicksPerSecond"]
  141. custom_minimum_size = Vector2(160, 0)
  142. layout_mode = 2
  143. size_flags_vertical = 4
  144. min_value = 10.0
  145. max_value = 240.0
  146. step = 10.0
  147. value = 60.0
  148. [node name="Value" type="Label" parent="Options/TicksPerSecond"]
  149. layout_mode = 2
  150. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  151. theme_override_constants/outline_size = 4
  152. text = "60"
  153. [node name="TimeScale" type="HBoxContainer" parent="Options"]
  154. layout_mode = 2
  155. tooltip_text = "Game speed multiplier. Physics ticks per second are
  156. automatically multiplied by Time Scale in this project
  157. to ensure accurate simulation regardless of time scale."
  158. theme_override_constants/separation = 10
  159. script = ExtResource("9_ycdy4")
  160. [node name="Label" type="Label" parent="Options/TimeScale"]
  161. custom_minimum_size = Vector2(164, 0)
  162. layout_mode = 2
  163. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  164. theme_override_constants/outline_size = 4
  165. text = "Time Scale"
  166. [node name="HSlider" type="HSlider" parent="Options/TimeScale"]
  167. custom_minimum_size = Vector2(160, 0)
  168. layout_mode = 2
  169. size_flags_vertical = 4
  170. max_value = 5.0
  171. step = 0.5
  172. value = 0.5
  173. [node name="Value" type="Label" parent="Options/TimeScale"]
  174. layout_mode = 2
  175. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  176. theme_override_constants/outline_size = 4
  177. text = "1.0×"
  178. [node name="MaxStepsPerFrame" type="HBoxContainer" parent="Options"]
  179. layout_mode = 2
  180. tooltip_text = "Physics will slow down if more physics steps
  181. than this value need to be simulated in a
  182. single rendered frame."
  183. theme_override_constants/separation = 10
  184. script = ExtResource("10_w48qg")
  185. [node name="Label" type="Label" parent="Options/MaxStepsPerFrame"]
  186. custom_minimum_size = Vector2(164, 0)
  187. layout_mode = 2
  188. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  189. theme_override_constants/outline_size = 4
  190. text = "Max Steps per Frame"
  191. [node name="HSlider" type="HSlider" parent="Options/MaxStepsPerFrame"]
  192. custom_minimum_size = Vector2(160, 0)
  193. layout_mode = 2
  194. size_flags_vertical = 4
  195. min_value = 1.0
  196. max_value = 20.0
  197. value = 8.0
  198. [node name="Value" type="Label" parent="Options/MaxStepsPerFrame"]
  199. layout_mode = 2
  200. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  201. theme_override_constants/outline_size = 4
  202. text = "8"
  203. [node name="PhysicsInterpolation" type="CheckButton" parent="Options"]
  204. custom_minimum_size = Vector2(217, 0)
  205. layout_mode = 2
  206. size_flags_horizontal = 0
  207. tooltip_text = "Smooths out rendering regardless of the physics tick rate.
  208. This is a purely visual effect and has no impact on the physics simulation."
  209. theme_override_constants/outline_size = 4
  210. button_pressed = true
  211. text = "Physics Interpolation"
  212. script = ExtResource("11_ycdy4")
  213. [node name="PanelLog" type="Panel" parent="."]
  214. layout_mode = 1
  215. anchors_preset = 3
  216. anchor_left = 1.0
  217. anchor_top = 1.0
  218. anchor_right = 1.0
  219. anchor_bottom = 1.0
  220. offset_left = -630.0
  221. offset_top = -251.0
  222. grow_horizontal = 0
  223. grow_vertical = 0
  224. mouse_filter = 1
  225. theme_override_styles/panel = SubResource("1")
  226. [node name="ButtonClear" type="Button" parent="PanelLog"]
  227. layout_mode = 1
  228. anchors_preset = 3
  229. anchor_left = 1.0
  230. anchor_top = 1.0
  231. anchor_right = 1.0
  232. anchor_bottom = 1.0
  233. offset_left = -65.0
  234. offset_top = -36.0
  235. offset_right = -5.0
  236. offset_bottom = -5.0
  237. grow_horizontal = 0
  238. grow_vertical = 0
  239. focus_mode = 0
  240. text = "Clear"
  241. [node name="CheckBoxScroll" type="CheckButton" parent="PanelLog"]
  242. layout_mode = 1
  243. anchors_preset = 3
  244. anchor_left = 1.0
  245. anchor_top = 1.0
  246. anchor_right = 1.0
  247. anchor_bottom = 1.0
  248. offset_left = -269.0
  249. offset_top = -35.0
  250. offset_right = -70.0
  251. offset_bottom = -4.0
  252. grow_horizontal = 0
  253. grow_vertical = 0
  254. focus_mode = 0
  255. button_pressed = true
  256. text = "Automatic Scrolling"
  257. [node name="ScrollLog" type="ScrollContainer" parent="PanelLog"]
  258. layout_mode = 0
  259. offset_left = 10.0
  260. offset_top = 5.0
  261. offset_right = 619.0
  262. offset_bottom = 210.0
  263. script = ExtResource("11")
  264. auto_scroll = true
  265. [node name="VBoxLog" type="VBoxContainer" parent="PanelLog/ScrollLog"]
  266. layout_mode = 2
  267. size_flags_horizontal = 3
  268. size_flags_vertical = 3
  269. alignment = 2
  270. script = ExtResource("10")
  271. [node name="LabelLog" type="Label" parent="PanelLog/ScrollLog/VBoxLog"]
  272. layout_mode = 2
  273. text = "Log start"
  274. max_lines_visible = 5
  275. [connection signal="value_changed" from="Options/TicksPerSecond/HSlider" to="Options/TicksPerSecond" method="_on_h_slider_value_changed"]
  276. [connection signal="value_changed" from="Options/TimeScale/HSlider" to="Options/TimeScale" method="_on_h_slider_value_changed"]
  277. [connection signal="value_changed" from="Options/MaxStepsPerFrame/HSlider" to="Options/MaxStepsPerFrame" method="_on_h_slider_value_changed"]
  278. [connection signal="toggled" from="Options/PhysicsInterpolation" to="Options/PhysicsInterpolation" method="_on_check_button_toggled"]
  279. [connection signal="pressed" from="PanelLog/ButtonClear" to="PanelLog/ScrollLog/VBoxLog" method="clear"]
  280. [connection signal="toggled" from="PanelLog/CheckBoxScroll" to="PanelLog/ScrollLog" method="_on_check_box_scroll_toggled"]