Skip to content

Commit c49e134

Browse files
idbriiaaronfranke
andauthored
Explain how to setup GUI in 3D (#1149)
Make it more obvious to newcomers how this demo works so they can replicate it in their projects. Change the text to point to how this is working. Add Editor Descriptions to make it clearer how this is setup. Co-authored-by: Aaron Franke <[email protected]>
1 parent 81249b3 commit c49e134

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

viewport/gui_in_3d/gui_panel_3d.tscn

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ process_mode = 3
2323
script = ExtResource("1")
2424

2525
[node name="SubViewport" type="SubViewport" parent="."]
26+
editor_description = "SubViewport contents can be displayed using a ViewportTexture."
2627
gui_embed_subwindows = true
2728
size = Vector2i(560, 360)
2829
render_target_update_mode = 4
@@ -51,9 +52,11 @@ grow_vertical = 2
5152
theme_override_constants/separation = 13
5253

5354
[node name="Label" type="Label" parent="SubViewport/GUI/Panel/VBoxContainer"]
55+
custom_minimum_size = Vector2(200, 0)
5456
layout_mode = 2
55-
text = "Hello world!"
57+
text = "SubViewport is rendered on Quad"
5658
horizontal_alignment = 1
59+
autowrap_mode = 2
5760

5861
[node name="Button" type="Button" parent="SubViewport/GUI/Panel/VBoxContainer"]
5962
layout_mode = 2
@@ -129,6 +132,12 @@ popup/item_2/text = "Item 2"
129132
popup/item_2/id = 2
130133

131134
[node name="Quad" type="MeshInstance3D" parent="."]
135+
editor_description = "To setup this MeshInstance3D:
136+
* Set Surface Material Override to a new StandardMaterial3D.
137+
* At the bottom of the StandardMaterial3D's properties, set \"Local to Scene\" to true.
138+
* Set the Albedo Texture of StandardMaterial3D to new ViewportTexture and set the Viewport Path.
139+
* Transparency to Alpha.
140+
* Shading to Unshaded."
132141
mesh = SubResource("1")
133142
surface_material_override/0 = SubResource("3")
134143

0 commit comments

Comments
 (0)