window_management.tscn 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. [gd_scene load_steps=9 format=3 uid="uid://cwvmsqurkf8aa"]
  2. [ext_resource type="PackedScene" uid="uid://dn8gun8srd127" path="res://observer/observer.tscn" id="1"]
  3. [ext_resource type="Script" path="res://control.gd" id="2"]
  4. [sub_resource type="Gradient" id="Gradient_oauk4"]
  5. colors = PackedColorArray(0.862745, 0.862745, 0.862745, 1, 1, 1, 1, 1)
  6. [sub_resource type="FastNoiseLite" id="FastNoiseLite_bkayj"]
  7. noise_type = 0
  8. frequency = 1.0
  9. [sub_resource type="NoiseTexture2D" id="NoiseTexture2D_t6ofl"]
  10. seamless = true
  11. color_ramp = SubResource("Gradient_oauk4")
  12. noise = SubResource("FastNoiseLite_bkayj")
  13. [sub_resource type="StandardMaterial3D" id="1"]
  14. transparency = 1
  15. albedo_color = Color(0.301961, 0.623529, 0.862745, 0.752941)
  16. albedo_texture = SubResource("NoiseTexture2D_t6ofl")
  17. uv1_scale = Vector3(3, 2, 1)
  18. texture_filter = 5
  19. [sub_resource type="BoxMesh" id="2"]
  20. material = SubResource("1")
  21. size = Vector3(5, 5, 5)
  22. [sub_resource type="BoxMesh" id="BoxMesh_3qo5i"]
  23. [node name="WindowManagement" type="Node3D"]
  24. [node name="Observer" parent="." instance=ExtResource("1")]
  25. transform = Transform3D(0.910685, 0, -0.4131, 0, 1, 0, 0.4131, 0, 0.910685, -4.81287, -0.152566, 9.90641)
  26. [node name="TestCube" type="MeshInstance3D" parent="."]
  27. mesh = SubResource("2")
  28. [node name="TestCube2" type="MeshInstance3D" parent="."]
  29. mesh = SubResource("BoxMesh_3qo5i")
  30. [node name="Control" type="Control" parent="."]
  31. layout_mode = 3
  32. anchors_preset = 15
  33. anchor_right = 1.0
  34. anchor_bottom = 1.0
  35. grow_horizontal = 2
  36. grow_vertical = 2
  37. size_flags_horizontal = 2
  38. size_flags_vertical = 2
  39. script = ExtResource("2")
  40. [node name="Buttons" type="VBoxContainer" parent="Control"]
  41. layout_mode = 1
  42. anchors_preset = 9
  43. anchor_bottom = 1.0
  44. offset_left = 10.0
  45. offset_top = 10.0
  46. offset_right = 335.0
  47. offset_bottom = -2.0
  48. grow_vertical = 2
  49. theme_override_constants/separation = 5
  50. metadata/_edit_layout_mode = 0
  51. metadata/_edit_use_custom_anchors = false
  52. [node name="Button_Fullscreen" type="Button" parent="Control/Buttons"]
  53. layout_mode = 2
  54. size_flags_horizontal = 2
  55. size_flags_vertical = 2
  56. toggle_mode = true
  57. text = "Fullscreen"
  58. metadata/_edit_layout_mode = 0
  59. metadata/_edit_use_custom_anchors = false
  60. [node name="Button_FixedSize" type="Button" parent="Control/Buttons"]
  61. layout_mode = 2
  62. size_flags_horizontal = 2
  63. size_flags_vertical = 2
  64. toggle_mode = true
  65. text = "Fixed Size"
  66. metadata/_edit_layout_mode = 0
  67. metadata/_edit_use_custom_anchors = false
  68. [node name="Button_Minimized" type="Button" parent="Control/Buttons"]
  69. layout_mode = 2
  70. size_flags_horizontal = 2
  71. size_flags_vertical = 2
  72. toggle_mode = true
  73. text = "Minimized"
  74. metadata/_edit_layout_mode = 0
  75. metadata/_edit_use_custom_anchors = false
  76. [node name="Button_Maximized" type="Button" parent="Control/Buttons"]
  77. layout_mode = 2
  78. size_flags_horizontal = 2
  79. size_flags_vertical = 2
  80. toggle_mode = true
  81. text = "Maximized"
  82. metadata/_edit_layout_mode = 0
  83. metadata/_edit_use_custom_anchors = false
  84. [node name="Button_MoveTo" type="Button" parent="Control/Buttons"]
  85. layout_mode = 2
  86. size_flags_horizontal = 2
  87. size_flags_vertical = 2
  88. text = "Move To"
  89. metadata/_edit_layout_mode = 0
  90. metadata/_edit_use_custom_anchors = false
  91. [node name="Button_Resize" type="Button" parent="Control/Buttons"]
  92. layout_mode = 2
  93. size_flags_horizontal = 2
  94. size_flags_vertical = 2
  95. text = "Resize"
  96. metadata/_edit_layout_mode = 0
  97. metadata/_edit_use_custom_anchors = false
  98. [node name="Button_Screen0" type="Button" parent="Control/Buttons"]
  99. layout_mode = 2
  100. size_flags_horizontal = 2
  101. size_flags_vertical = 2
  102. text = "Screen0"
  103. metadata/_edit_layout_mode = 0
  104. metadata/_edit_use_custom_anchors = false
  105. [node name="Button_Screen1" type="Button" parent="Control/Buttons"]
  106. layout_mode = 2
  107. size_flags_horizontal = 2
  108. size_flags_vertical = 2
  109. text = "Screen1"
  110. metadata/_edit_layout_mode = 0
  111. metadata/_edit_use_custom_anchors = false
  112. [node name="Label_MouseModes" type="Label" parent="Control/Buttons"]
  113. layout_mode = 2
  114. size_flags_horizontal = 2
  115. size_flags_vertical = 0
  116. text = "MouseModes:"
  117. metadata/_edit_layout_mode = 1
  118. metadata/_edit_use_custom_anchors = false
  119. [node name="Button_MouseModeVisible" type="Button" parent="Control/Buttons"]
  120. layout_mode = 2
  121. size_flags_horizontal = 2
  122. size_flags_vertical = 2
  123. toggle_mode = true
  124. text = "[F1] MOUSE_MODE_VISIBLE"
  125. metadata/_edit_layout_mode = 1
  126. metadata/_edit_use_custom_anchors = false
  127. [node name="Button_MouseModeHidden" type="Button" parent="Control/Buttons"]
  128. layout_mode = 2
  129. size_flags_horizontal = 2
  130. size_flags_vertical = 2
  131. toggle_mode = true
  132. text = "[F2] MOUSE_MODE_HIDDEN"
  133. metadata/_edit_layout_mode = 1
  134. metadata/_edit_use_custom_anchors = false
  135. [node name="Button_MouseModeCaptured" type="Button" parent="Control/Buttons"]
  136. layout_mode = 2
  137. size_flags_horizontal = 2
  138. size_flags_vertical = 2
  139. toggle_mode = true
  140. text = "[F3] MOUSE_MODE_CAPTURED"
  141. metadata/_edit_layout_mode = 1
  142. metadata/_edit_use_custom_anchors = false
  143. [node name="Button_MouseModeConfined" type="Button" parent="Control/Buttons"]
  144. layout_mode = 2
  145. size_flags_horizontal = 2
  146. size_flags_vertical = 2
  147. toggle_mode = true
  148. text = "[F4] MOUSE_MODE_CONFINED"
  149. metadata/_edit_layout_mode = 1
  150. metadata/_edit_use_custom_anchors = false
  151. [node name="Button_MouseModeConfinedHidden" type="Button" parent="Control/Buttons"]
  152. layout_mode = 2
  153. size_flags_horizontal = 2
  154. size_flags_vertical = 2
  155. toggle_mode = true
  156. text = "[F5] MOUSE_MODE_CONFINED_HIDDEN"
  157. metadata/_edit_layout_mode = 1
  158. metadata/_edit_use_custom_anchors = false
  159. [node name="Label_MouseModeCaptured_KeyInfo" type="Label" parent="Control/Buttons"]
  160. layout_mode = 2
  161. size_flags_horizontal = 2
  162. size_flags_vertical = 0
  163. text = "ESC: Deactivate MOUSE_MODE_CAPTURED
  164. W, S: Move forward, backward
  165. A, D: Strafe left, right"
  166. metadata/_edit_layout_mode = 1
  167. metadata/_edit_use_custom_anchors = false
  168. [node name="Labels" type="VBoxContainer" parent="Control"]
  169. layout_mode = 1
  170. anchors_preset = 11
  171. anchor_left = 1.0
  172. anchor_right = 1.0
  173. anchor_bottom = 1.0
  174. offset_left = -241.0
  175. offset_top = 10.0
  176. offset_right = -10.0
  177. offset_bottom = -10.0
  178. grow_horizontal = 0
  179. grow_vertical = 2
  180. theme_override_constants/separation = 10
  181. metadata/_edit_layout_mode = 1
  182. metadata/_edit_use_custom_anchors = false
  183. [node name="Label_Mode" type="Label" parent="Control/Labels"]
  184. layout_mode = 2
  185. size_flags_horizontal = 2
  186. size_flags_vertical = 0
  187. text = "Mode:"
  188. metadata/_edit_layout_mode = 1
  189. metadata/_edit_use_custom_anchors = false
  190. [node name="Label_Position" type="Label" parent="Control/Labels"]
  191. layout_mode = 2
  192. size_flags_horizontal = 2
  193. size_flags_vertical = 0
  194. text = "Position:"
  195. metadata/_edit_layout_mode = 1
  196. metadata/_edit_use_custom_anchors = false
  197. [node name="Label_Size" type="Label" parent="Control/Labels"]
  198. layout_mode = 2
  199. size_flags_horizontal = 2
  200. size_flags_vertical = 0
  201. text = "Size:"
  202. metadata/_edit_layout_mode = 1
  203. metadata/_edit_use_custom_anchors = false
  204. [node name="Label_MousePosition" type="Label" parent="Control/Labels"]
  205. layout_mode = 2
  206. size_flags_horizontal = 2
  207. size_flags_vertical = 0
  208. text = "Mouse Position:"
  209. metadata/_edit_layout_mode = 1
  210. metadata/_edit_use_custom_anchors = false
  211. [node name="Label_Screen_Count" type="Label" parent="Control/Labels"]
  212. layout_mode = 2
  213. size_flags_horizontal = 2
  214. size_flags_vertical = 0
  215. text = "Screen_Count:"
  216. metadata/_edit_layout_mode = 1
  217. metadata/_edit_use_custom_anchors = false
  218. [node name="Label_Screen_Current" type="Label" parent="Control/Labels"]
  219. layout_mode = 2
  220. size_flags_horizontal = 2
  221. size_flags_vertical = 0
  222. text = "Screen:"
  223. metadata/_edit_layout_mode = 1
  224. metadata/_edit_use_custom_anchors = false
  225. [node name="Label_Screen0_Resolution" type="Label" parent="Control/Labels"]
  226. layout_mode = 2
  227. size_flags_horizontal = 2
  228. size_flags_vertical = 0
  229. text = "Screen0 Resolution: "
  230. metadata/_edit_layout_mode = 1
  231. metadata/_edit_use_custom_anchors = false
  232. [node name="Label_Screen0_Position" type="Label" parent="Control/Labels"]
  233. layout_mode = 2
  234. size_flags_horizontal = 2
  235. size_flags_vertical = 0
  236. text = "Screen0 Position: "
  237. metadata/_edit_layout_mode = 1
  238. metadata/_edit_use_custom_anchors = false
  239. [node name="Label_Screen0_DPI" type="Label" parent="Control/Labels"]
  240. layout_mode = 2
  241. size_flags_horizontal = 2
  242. size_flags_vertical = 0
  243. text = "Screen0 DPI:"
  244. metadata/_edit_layout_mode = 1
  245. metadata/_edit_use_custom_anchors = false
  246. [node name="Label_Screen0_RefreshRate" type="Label" parent="Control/Labels"]
  247. layout_mode = 2
  248. size_flags_horizontal = 2
  249. size_flags_vertical = 0
  250. text = "Screen0 Refresh Rate:"
  251. metadata/_edit_layout_mode = 1
  252. metadata/_edit_use_custom_anchors = false
  253. [node name="Label_Screen1_Resolution" type="Label" parent="Control/Labels"]
  254. layout_mode = 2
  255. size_flags_horizontal = 2
  256. size_flags_vertical = 0
  257. text = "Screen1 Resolution: "
  258. metadata/_edit_layout_mode = 1
  259. metadata/_edit_use_custom_anchors = false
  260. [node name="Label_Screen1_Position" type="Label" parent="Control/Labels"]
  261. layout_mode = 2
  262. size_flags_horizontal = 2
  263. size_flags_vertical = 0
  264. text = "Screen1 Position: "
  265. metadata/_edit_layout_mode = 1
  266. metadata/_edit_use_custom_anchors = false
  267. [node name="Label_Screen1_DPI" type="Label" parent="Control/Labels"]
  268. layout_mode = 2
  269. size_flags_horizontal = 2
  270. size_flags_vertical = 0
  271. text = "Screen1 DPI:"
  272. metadata/_edit_layout_mode = 1
  273. metadata/_edit_use_custom_anchors = false
  274. [node name="Label_Screen1_RefreshRate" type="Label" parent="Control/Labels"]
  275. layout_mode = 2
  276. size_flags_horizontal = 2
  277. size_flags_vertical = 0
  278. text = "Screen1 Refresh Rate:"
  279. metadata/_edit_layout_mode = 1
  280. metadata/_edit_use_custom_anchors = false
  281. [node name="ImplementationDialog" type="AcceptDialog" parent="Control"]
  282. size = Vector2i(470, 213)
  283. [node name="Text" type="Label" parent="Control/ImplementationDialog"]
  284. offset_left = 8.0
  285. offset_top = 8.0
  286. offset_right = 462.0
  287. offset_bottom = 164.0
  288. size_flags_horizontal = 2
  289. size_flags_vertical = 0
  290. text = "This is an Implementation-Test-Demo
  291. It is used to help implementing a new window handling api
  292. across platforms.
  293. Your platform lacks at the moment the following methods:
  294. "
  295. [node name="CheckButton" type="CheckButton" parent="Control"]
  296. layout_mode = 1
  297. anchors_preset = 3
  298. anchor_left = 1.0
  299. anchor_top = 1.0
  300. anchor_right = 1.0
  301. anchor_bottom = 1.0
  302. offset_left = -160.0
  303. offset_top = -47.0
  304. offset_right = -16.0
  305. offset_bottom = -16.0
  306. grow_horizontal = 0
  307. grow_vertical = 0
  308. text = "Transparent"
  309. [connection signal="pressed" from="Control/Buttons/Button_Fullscreen" to="Control" method="_on_Button_Fullscreen_pressed"]
  310. [connection signal="pressed" from="Control/Buttons/Button_FixedSize" to="Control" method="_on_Button_FixedSize_pressed"]
  311. [connection signal="pressed" from="Control/Buttons/Button_Minimized" to="Control" method="_on_Button_Minimized_pressed"]
  312. [connection signal="pressed" from="Control/Buttons/Button_Maximized" to="Control" method="_on_Button_Maximized_pressed"]
  313. [connection signal="pressed" from="Control/Buttons/Button_MoveTo" to="Control" method="_on_Button_MoveTo_pressed"]
  314. [connection signal="pressed" from="Control/Buttons/Button_Resize" to="Control" method="_on_Button_Resize_pressed"]
  315. [connection signal="pressed" from="Control/Buttons/Button_Screen0" to="Control" method="_on_Button_Screen0_pressed"]
  316. [connection signal="pressed" from="Control/Buttons/Button_Screen1" to="Control" method="_on_Button_Screen1_pressed"]
  317. [connection signal="pressed" from="Control/Buttons/Button_MouseModeVisible" to="Control" method="_on_Button_MouseModeVisible_pressed"]
  318. [connection signal="pressed" from="Control/Buttons/Button_MouseModeHidden" to="Control" method="_on_Button_MouseModeHidden_pressed"]
  319. [connection signal="pressed" from="Control/Buttons/Button_MouseModeCaptured" to="Control" method="_on_Button_MouseModeCaptured_pressed"]
  320. [connection signal="pressed" from="Control/Buttons/Button_MouseModeConfined" to="Control" method="_on_Button_MouseModeConfined_pressed"]
  321. [connection signal="pressed" from="Control/Buttons/Button_MouseModeConfinedHidden" to="Control" method="_on_Button_MouseModeConfinedHidden_pressed"]
  322. [connection signal="toggled" from="Control/CheckButton" to="Observer" method="_on_transparent_check_button_toggled"]