gui_panel_3d.tscn 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. [gd_scene load_steps=7 format=3 uid="uid://dvl383ispakmn"]
  2. [ext_resource type="Script" path="res://gui_3d.gd" id="1"]
  3. [ext_resource type="Texture2D" uid="uid://brwp8bimc75uu" path="res://icon.webp" id="2"]
  4. [sub_resource type="QuadMesh" id="1"]
  5. size = Vector2(3, 2)
  6. [sub_resource type="ViewportTexture" id="2"]
  7. viewport_path = NodePath("SubViewport")
  8. [sub_resource type="StandardMaterial3D" id="3"]
  9. resource_local_to_scene = true
  10. transparency = 1
  11. shading_mode = 0
  12. albedo_texture = SubResource("2")
  13. [sub_resource type="BoxShape3D" id="4"]
  14. size = Vector3(3, 2, 0.1)
  15. [node name="GUIPanel3D" type="Node3D"]
  16. process_mode = 3
  17. script = ExtResource("1")
  18. [node name="SubViewport" type="SubViewport" parent="."]
  19. gui_embed_subwindows = true
  20. size = Vector2i(280, 180)
  21. render_target_update_mode = 4
  22. [node name="GUI" type="Control" parent="SubViewport"]
  23. layout_mode = 3
  24. anchors_preset = 0
  25. offset_right = 280.0
  26. offset_bottom = 180.0
  27. mouse_filter = 1
  28. [node name="Panel" type="Panel" parent="SubViewport/GUI"]
  29. layout_mode = 0
  30. anchor_right = 1.0
  31. anchor_bottom = 1.0
  32. [node name="VBoxContainer" type="VBoxContainer" parent="SubViewport/GUI/Panel"]
  33. layout_mode = 0
  34. anchor_bottom = 1.0
  35. offset_left = 10.0
  36. offset_top = 10.0
  37. offset_right = 150.0
  38. offset_bottom = -10.0
  39. grow_vertical = 2
  40. theme_override_constants/separation = 13
  41. [node name="Label" type="Label" parent="SubViewport/GUI/Panel/VBoxContainer"]
  42. layout_mode = 2
  43. text = "Hello world!"
  44. horizontal_alignment = 1
  45. [node name="Button" type="Button" parent="SubViewport/GUI/Panel/VBoxContainer"]
  46. layout_mode = 2
  47. text = "A button!"
  48. [node name="TextEdit" type="LineEdit" parent="SubViewport/GUI/Panel/VBoxContainer"]
  49. layout_mode = 2
  50. [node name="HSlider" type="HSlider" parent="SubViewport/GUI/Panel/VBoxContainer"]
  51. layout_mode = 2
  52. ticks_on_borders = true
  53. [node name="ColorRect" type="ColorRect" parent="SubViewport/GUI/Panel"]
  54. layout_mode = 0
  55. anchor_left = 1.0
  56. anchor_right = 1.0
  57. offset_left = -110.0
  58. offset_top = 16.0
  59. offset_right = -46.0
  60. offset_bottom = 80.0
  61. color = Color(1, 0, 0, 1)
  62. [node name="TextureRect" type="TextureRect" parent="SubViewport/GUI/Panel"]
  63. layout_mode = 0
  64. anchor_left = 1.0
  65. anchor_right = 1.0
  66. offset_left = -102.0
  67. offset_top = 24.0
  68. offset_right = -54.0
  69. offset_bottom = 72.0
  70. grow_horizontal = 2
  71. grow_vertical = 2
  72. texture = ExtResource("2")
  73. expand_mode = 1
  74. [node name="VSlider" type="VSlider" parent="SubViewport/GUI/Panel"]
  75. layout_mode = 0
  76. anchor_left = 1.0
  77. anchor_right = 1.0
  78. anchor_bottom = 1.0
  79. offset_left = -25.0
  80. offset_top = 5.0
  81. offset_right = -5.0
  82. offset_bottom = -5.0
  83. grow_horizontal = 0
  84. grow_vertical = 2
  85. [node name="OptionButton" type="OptionButton" parent="SubViewport/GUI/Panel"]
  86. layout_mode = 0
  87. anchor_left = 1.0
  88. anchor_top = 1.0
  89. anchor_right = 1.0
  90. anchor_bottom = 1.0
  91. offset_left = -120.0
  92. offset_top = -80.0
  93. offset_right = -28.0
  94. offset_bottom = -26.0
  95. grow_horizontal = 0
  96. grow_vertical = 0
  97. item_count = 3
  98. popup/item_0/text = "Item 0"
  99. popup/item_0/id = 0
  100. popup/item_1/text = "Item 1"
  101. popup/item_1/id = 1
  102. popup/item_2/text = "Item 2"
  103. popup/item_2/id = 2
  104. [node name="Quad" type="MeshInstance3D" parent="."]
  105. mesh = SubResource("1")
  106. surface_material_override/0 = SubResource("3")
  107. [node name="Area3D" type="Area3D" parent="Quad"]
  108. collision_layer = 2
  109. input_capture_on_drag = true
  110. [node name="CollisionShape3D" type="CollisionShape3D" parent="Quad/Area3D"]
  111. shape = SubResource("4")