window_management.tscn 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. [gd_scene load_steps=5 format=2]
  2. [ext_resource path="res://observer/observer.tscn" type="PackedScene" id=1]
  3. [ext_resource path="res://control.gd" type="Script" id=2]
  4. [sub_resource type="SpatialMaterial" id=1]
  5. albedo_color = Color( 0.835294, 0.133333, 0.133333, 1 )
  6. [sub_resource type="CubeMesh" id=2]
  7. material = SubResource( 1 )
  8. size = Vector3( 5, 5, 5 )
  9. [node name="WindowManagement" type="Spatial"]
  10. [node name="Observer" parent="." instance=ExtResource( 1 )]
  11. transform = Transform( 0.910685, 0, -0.4131, 0, 1, 0, 0.4131, 0, 0.910685, -4.81287, -0.152566, 9.90641 )
  12. [node name="TestCube" type="MeshInstance" parent="."]
  13. mesh = SubResource( 2 )
  14. material/0 = null
  15. [node name="Control" type="Control" parent="."]
  16. anchor_right = 1.0
  17. anchor_bottom = 1.0
  18. size_flags_horizontal = 2
  19. size_flags_vertical = 2
  20. script = ExtResource( 2 )
  21. [node name="Button_Fullscreen" type="Button" parent="Control"]
  22. margin_left = 20.0
  23. margin_top = 20.0
  24. margin_right = 120.0
  25. margin_bottom = 45.0
  26. size_flags_horizontal = 2
  27. size_flags_vertical = 2
  28. toggle_mode = true
  29. text = "Fullscreen"
  30. [node name="Button_FixedSize" type="Button" parent="Control"]
  31. margin_left = 20.0
  32. margin_top = 60.0
  33. margin_right = 120.0
  34. margin_bottom = 85.0
  35. size_flags_horizontal = 2
  36. size_flags_vertical = 2
  37. toggle_mode = true
  38. text = "FixedSize"
  39. [node name="Button_Minimized" type="Button" parent="Control"]
  40. margin_left = 20.0
  41. margin_top = 100.0
  42. margin_right = 120.0
  43. margin_bottom = 125.0
  44. size_flags_horizontal = 2
  45. size_flags_vertical = 2
  46. toggle_mode = true
  47. text = "Minimized"
  48. [node name="Button_Maximized" type="Button" parent="Control"]
  49. margin_left = 20.0
  50. margin_top = 140.0
  51. margin_right = 120.0
  52. margin_bottom = 165.0
  53. size_flags_horizontal = 2
  54. size_flags_vertical = 2
  55. toggle_mode = true
  56. text = "Maximized"
  57. [node name="Button_MoveTo" type="Button" parent="Control"]
  58. margin_left = 20.0
  59. margin_top = 178.0
  60. margin_right = 120.0
  61. margin_bottom = 203.0
  62. size_flags_horizontal = 2
  63. size_flags_vertical = 2
  64. text = "MoveTo"
  65. [node name="Button_Resize" type="Button" parent="Control"]
  66. margin_left = 20.0
  67. margin_top = 218.0
  68. margin_right = 120.0
  69. margin_bottom = 243.0
  70. size_flags_horizontal = 2
  71. size_flags_vertical = 2
  72. text = "Resize"
  73. [node name="Button_Screen0" type="Button" parent="Control"]
  74. margin_left = 20.0
  75. margin_top = 258.0
  76. margin_right = 120.0
  77. margin_bottom = 283.0
  78. size_flags_horizontal = 2
  79. size_flags_vertical = 2
  80. text = "Screen0"
  81. [node name="Button_Screen1" type="Button" parent="Control"]
  82. margin_left = 20.0
  83. margin_top = 298.0
  84. margin_right = 120.0
  85. margin_bottom = 323.0
  86. size_flags_horizontal = 2
  87. size_flags_vertical = 2
  88. text = "Screen1"
  89. [node name="Button_MouseModeVisible" type="Button" parent="Control"]
  90. anchor_top = 1.0
  91. anchor_bottom = 1.0
  92. margin_left = 20.0
  93. margin_top = -221.0
  94. margin_right = 225.0
  95. margin_bottom = -196.0
  96. size_flags_horizontal = 2
  97. size_flags_vertical = 2
  98. toggle_mode = true
  99. text = "[F1] MOUSE_MODE_VISIBLE"
  100. align = 0
  101. [node name="Button_MouseModeHidden" type="Button" parent="Control"]
  102. anchor_top = 1.0
  103. anchor_bottom = 1.0
  104. margin_left = 20.0
  105. margin_top = -186.0
  106. margin_right = 225.0
  107. margin_bottom = -161.0
  108. size_flags_horizontal = 2
  109. size_flags_vertical = 2
  110. toggle_mode = true
  111. text = "[F2] MOUSE_MODE_HIDDEN"
  112. align = 0
  113. [node name="Button_MouseModeCaptured" type="Button" parent="Control"]
  114. anchor_top = 1.0
  115. anchor_bottom = 1.0
  116. margin_left = 20.0
  117. margin_top = -151.0
  118. margin_right = 225.0
  119. margin_bottom = -126.0
  120. size_flags_horizontal = 2
  121. size_flags_vertical = 2
  122. toggle_mode = true
  123. text = "[F3] MOUSE_MODE_CAPTURED"
  124. align = 0
  125. [node name="Label_Mode" type="Label" parent="Control"]
  126. anchor_left = 1.0
  127. anchor_right = 1.0
  128. margin_left = -140.0
  129. margin_top = 140.0
  130. margin_right = -20.0
  131. margin_bottom = 153.0
  132. size_flags_horizontal = 2
  133. size_flags_vertical = 0
  134. text = "Mode:"
  135. [node name="Label_Position" type="Label" parent="Control"]
  136. anchor_left = 1.0
  137. anchor_right = 1.0
  138. margin_left = -140.0
  139. margin_top = 60.0
  140. margin_right = -20.0
  141. margin_bottom = 73.0
  142. size_flags_horizontal = 2
  143. size_flags_vertical = 0
  144. text = "Position:"
  145. valign = 1
  146. [node name="Label_Size" type="Label" parent="Control"]
  147. anchor_left = 1.0
  148. anchor_right = 1.0
  149. margin_left = -140.0
  150. margin_top = 100.0
  151. margin_right = -20.0
  152. margin_bottom = 113.0
  153. size_flags_horizontal = 2
  154. size_flags_vertical = 0
  155. text = "Size:"
  156. valign = 1
  157. [node name="Label_MousePosition" type="Label" parent="Control"]
  158. anchor_left = 1.0
  159. anchor_right = 1.0
  160. margin_left = -140.0
  161. margin_top = 220.0
  162. margin_right = -20.0
  163. margin_bottom = 153.0
  164. size_flags_horizontal = 2
  165. size_flags_vertical = 0
  166. text = "Mouse Position:"
  167. [node name="Label_Screen_Count" type="Label" parent="Control"]
  168. anchor_left = 1.0
  169. anchor_right = 1.0
  170. margin_left = -140.0
  171. margin_top = 300.0
  172. margin_right = -20.0
  173. margin_bottom = 314.0
  174. size_flags_horizontal = 2
  175. size_flags_vertical = 0
  176. text = "Screen_Count:"
  177. valign = 1
  178. [node name="Label_Screen_Current" type="Label" parent="Control"]
  179. anchor_left = 1.0
  180. anchor_right = 1.0
  181. margin_left = -140.0
  182. margin_top = 20.0
  183. margin_right = -20.0
  184. margin_bottom = 40.0
  185. size_flags_horizontal = 2
  186. size_flags_vertical = 0
  187. text = "Screen:"
  188. valign = 1
  189. [node name="Label_Screen0_Resolution" type="Label" parent="Control"]
  190. anchor_left = 1.0
  191. anchor_right = 1.0
  192. margin_left = -140.0
  193. margin_top = 340.0
  194. margin_right = -16.0
  195. margin_bottom = 353.0
  196. size_flags_horizontal = 2
  197. size_flags_vertical = 0
  198. text = "Screen0 Resolution: "
  199. valign = 1
  200. [node name="Label_Screen0_Position" type="Label" parent="Control"]
  201. anchor_left = 1.0
  202. anchor_right = 1.0
  203. margin_left = -140.0
  204. margin_top = 380.0
  205. margin_right = -16.0
  206. margin_bottom = 396.0
  207. size_flags_horizontal = 2
  208. size_flags_vertical = 0
  209. text = "Screen0 Position: "
  210. valign = 1
  211. [node name="Label_Screen0_DPI" type="Label" parent="Control"]
  212. anchor_left = 1.0
  213. anchor_right = 1.0
  214. margin_left = -140.0
  215. margin_top = 416.0
  216. margin_right = -16.0
  217. margin_bottom = 432.0
  218. size_flags_horizontal = 2
  219. size_flags_vertical = 0
  220. text = "Screen0 DPI:"
  221. valign = 1
  222. [node name="Label_Screen1_Resolution" type="Label" parent="Control"]
  223. anchor_left = 1.0
  224. anchor_right = 1.0
  225. margin_left = -140.0
  226. margin_top = 451.0
  227. margin_right = -16.0
  228. margin_bottom = 467.0
  229. size_flags_horizontal = 2
  230. size_flags_vertical = 0
  231. text = "Screen1 Resolution: "
  232. valign = 1
  233. [node name="Label_Screen1_Position" type="Label" parent="Control"]
  234. anchor_left = 1.0
  235. anchor_right = 1.0
  236. margin_left = -140.0
  237. margin_top = 489.0
  238. margin_right = -16.0
  239. margin_bottom = 505.0
  240. size_flags_horizontal = 2
  241. size_flags_vertical = 0
  242. text = "Screen1 Position: "
  243. valign = 1
  244. [node name="Label_Screen1_DPI" type="Label" parent="Control"]
  245. anchor_left = 1.0
  246. anchor_right = 1.0
  247. margin_left = -140.0
  248. margin_top = 524.0
  249. margin_right = -16.0
  250. margin_bottom = 540.0
  251. size_flags_horizontal = 2
  252. size_flags_vertical = 0
  253. text = "Screen1 DPI:"
  254. valign = 1
  255. [node name="Label_KeyInfo" type="Label" parent="Control"]
  256. anchor_top = 1.0
  257. anchor_bottom = 1.0
  258. margin_left = 20.0
  259. margin_top = -122.0
  260. margin_right = 286.0
  261. margin_bottom = -63.0
  262. size_flags_horizontal = 2
  263. size_flags_vertical = 0
  264. text = "F1: Activate MOUSE_MODE_VISIBLE
  265. F2: Activate MOUSE_MODE_HIDDEN
  266. F3: Activate MOUSE_MODE_CAPTURED"
  267. valign = 2
  268. [node name="Label_MouseModeCaptured_KeyInfo" type="Label" parent="Control"]
  269. anchor_top = 1.0
  270. anchor_bottom = 1.0
  271. margin_left = 20.0
  272. margin_top = -65.0
  273. margin_right = 286.0
  274. margin_bottom = -11.0
  275. size_flags_horizontal = 2
  276. size_flags_vertical = 0
  277. text = "ESC: Deactivate MOUSE_MODE_CAPTURED
  278. W, S: Move forward, backward
  279. A, D: Strafe left, right"
  280. valign = 2
  281. [node name="Label_MouseModes" type="Label" parent="Control"]
  282. anchor_top = 1.0
  283. anchor_bottom = 1.0
  284. margin_left = 20.0
  285. margin_top = -249.0
  286. margin_right = 286.0
  287. margin_bottom = -227.0
  288. size_flags_horizontal = 2
  289. size_flags_vertical = 0
  290. text = "MouseModes:"
  291. valign = 2
  292. [node name="ImplementationDialog" type="AcceptDialog" parent="Control"]
  293. margin_left = 200.0
  294. margin_top = 100.0
  295. margin_right = 600.0
  296. margin_bottom = 450.0
  297. size_flags_horizontal = 2
  298. size_flags_vertical = 2
  299. window_title = "Please be advised..."
  300. [node name="Text" type="Label" parent="Control/ImplementationDialog"]
  301. margin_left = 8.0
  302. margin_top = 8.0
  303. margin_right = 392.0
  304. margin_bottom = 314.0
  305. size_flags_horizontal = 2
  306. size_flags_vertical = 0
  307. text = "This is an Implementation-Test-Demo
  308. It is used to help implementing a new window handling api
  309. across platforms.
  310. Your platform lacks at the moment the following methods:
  311. "
  312. [connection signal="pressed" from="Control/Button_Fullscreen" to="Control" method="_on_Button_Fullscreen_pressed"]
  313. [connection signal="pressed" from="Control/Button_FixedSize" to="Control" method="_on_Button_FixedSize_pressed"]
  314. [connection signal="pressed" from="Control/Button_Minimized" to="Control" method="_on_Button_Minimized_pressed"]
  315. [connection signal="pressed" from="Control/Button_Maximized" to="Control" method="_on_Button_Maximized_pressed"]
  316. [connection signal="pressed" from="Control/Button_MoveTo" to="Control" method="_on_Button_MoveTo_pressed"]
  317. [connection signal="pressed" from="Control/Button_Resize" to="Control" method="_on_Button_Resize_pressed"]
  318. [connection signal="pressed" from="Control/Button_Screen0" to="Control" method="_on_Button_Screen0_pressed"]
  319. [connection signal="pressed" from="Control/Button_Screen1" to="Control" method="_on_Button_Screen1_pressed"]
  320. [connection signal="pressed" from="Control/Button_MouseModeVisible" to="Control" method="_on_Button_MouseModeVisible_pressed"]
  321. [connection signal="pressed" from="Control/Button_MouseModeHidden" to="Control" method="_on_Button_MouseModeHidden_pressed"]
  322. [connection signal="pressed" from="Control/Button_MouseModeCaptured" to="Control" method="_on_Button_MouseModeCaptured_pressed"]