gui_panel_3d.tscn 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. editor_description = "SubViewport contents can be displayed using a ViewportTexture."
  20. gui_embed_subwindows = true
  21. size = Vector2i(560, 360)
  22. render_target_update_mode = 4
  23. [node name="GUI" type="Control" parent="SubViewport"]
  24. layout_mode = 3
  25. anchors_preset = 0
  26. offset_right = 560.0
  27. offset_bottom = 360.0
  28. mouse_filter = 1
  29. [node name="Panel" type="Panel" parent="SubViewport/GUI"]
  30. layout_mode = 0
  31. anchor_right = 1.0
  32. anchor_bottom = 1.0
  33. [node name="VBoxContainer" type="VBoxContainer" parent="SubViewport/GUI/Panel"]
  34. layout_mode = 1
  35. anchors_preset = 9
  36. anchor_bottom = 1.0
  37. offset_left = 20.0
  38. offset_top = 20.0
  39. offset_right = 319.0
  40. offset_bottom = -20.0
  41. grow_vertical = 2
  42. theme_override_constants/separation = 13
  43. [node name="Label" type="Label" parent="SubViewport/GUI/Panel/VBoxContainer"]
  44. custom_minimum_size = Vector2(200, 0)
  45. layout_mode = 2
  46. text = "SubViewport is rendered on Quad"
  47. horizontal_alignment = 1
  48. autowrap_mode = 2
  49. [node name="Button" type="Button" parent="SubViewport/GUI/Panel/VBoxContainer"]
  50. layout_mode = 2
  51. text = "A button!"
  52. [node name="LineEdit" type="LineEdit" parent="SubViewport/GUI/Panel/VBoxContainer"]
  53. layout_mode = 2
  54. placeholder_text = "Enter text here..."
  55. [node name="HSlider" type="HSlider" parent="SubViewport/GUI/Panel/VBoxContainer"]
  56. layout_mode = 2
  57. step = 0.0
  58. ticks_on_borders = true
  59. [node name="ColorRect" type="ColorRect" parent="SubViewport/GUI/Panel"]
  60. layout_mode = 1
  61. anchors_preset = 1
  62. anchor_left = 1.0
  63. anchor_right = 1.0
  64. offset_left = -182.0
  65. offset_top = 16.0
  66. offset_right = -54.0
  67. offset_bottom = 144.0
  68. grow_horizontal = 0
  69. color = Color(1, 0, 0, 1)
  70. [node name="TextureRect" type="TextureRect" parent="SubViewport/GUI/Panel"]
  71. layout_mode = 1
  72. anchors_preset = 1
  73. anchor_left = 1.0
  74. anchor_right = 1.0
  75. offset_left = -166.0
  76. offset_top = 32.0
  77. offset_right = -70.0
  78. offset_bottom = 128.0
  79. grow_horizontal = 0
  80. texture = ExtResource("2")
  81. expand_mode = 1
  82. [node name="VSlider" type="VSlider" parent="SubViewport/GUI/Panel"]
  83. layout_mode = 1
  84. anchors_preset = 11
  85. anchor_left = 1.0
  86. anchor_right = 1.0
  87. anchor_bottom = 1.0
  88. offset_left = -37.0
  89. offset_top = 16.0
  90. offset_right = -5.0
  91. offset_bottom = -16.0
  92. grow_horizontal = 0
  93. grow_vertical = 2
  94. step = 0.0
  95. [node name="OptionButton" type="OptionButton" parent="SubViewport/GUI/Panel"]
  96. layout_mode = 1
  97. anchors_preset = 3
  98. anchor_left = 1.0
  99. anchor_top = 1.0
  100. anchor_right = 1.0
  101. anchor_bottom = 1.0
  102. offset_left = -227.0
  103. offset_top = -208.0
  104. offset_right = -39.0
  105. offset_bottom = -147.0
  106. grow_horizontal = 0
  107. grow_vertical = 0
  108. selected = 0
  109. item_count = 3
  110. popup/item_0/text = "Item 0"
  111. popup/item_1/text = "Item 1"
  112. popup/item_1/id = 1
  113. popup/item_2/text = "Item 2"
  114. popup/item_2/id = 2
  115. [node name="Quad" type="MeshInstance3D" parent="."]
  116. editor_description = "To setup this MeshInstance3D:
  117. * Set Surface Material Override to a new StandardMaterial3D.
  118. * At the bottom of the StandardMaterial3D's properties, set \"Local to Scene\" to true.
  119. * Set the Albedo Texture of StandardMaterial3D to new ViewportTexture and set the Viewport Path.
  120. * Transparency to Alpha.
  121. * Shading to Unshaded."
  122. mesh = SubResource("1")
  123. surface_material_override/0 = SubResource("3")
  124. [node name="Area3D" type="Area3D" parent="Quad"]
  125. collision_layer = 2
  126. input_capture_on_drag = true
  127. [node name="CollisionShape3D" type="CollisionShape3D" parent="Quad/Area3D"]
  128. shape = SubResource("4")