Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to setup gui_in_3d #1149

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion viewport/gui_in_3d/gui_panel_3d.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ process_mode = 3
script = ExtResource("1")

[node name="SubViewport" type="SubViewport" parent="."]
editor_description = "SubViewport allows us to use a ViewportTexture to display the contents of this viewport."
idbrii marked this conversation as resolved.
Show resolved Hide resolved
gui_embed_subwindows = true
size = Vector2i(560, 360)
render_target_update_mode = 4
Expand Down Expand Up @@ -51,9 +52,11 @@ grow_vertical = 2
theme_override_constants/separation = 13

[node name="Label" type="Label" parent="SubViewport/GUI/Panel/VBoxContainer"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
text = "Hello world!"
text = "SubViewport is rendered on Quad"
horizontal_alignment = 1
autowrap_mode = 2

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

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

Expand Down