Browse Source

Merge pull request #6965 from frigorific44/patch-1

Update rename changes to SurfaceTool
Max Hilbrunner 2 năm trước cách đây
mục cha
commit
e61ad46a09
1 tập tin đã thay đổi với 10 bổ sung10 xóa
  1. 10 10
      tutorials/3d/procedural_geometry/surfacetool.rst

+ 10 - 10
tutorials/3d/procedural_geometry/surfacetool.rst

@@ -15,11 +15,11 @@ Attributes are added before each vertex is added:
 .. tabs::
  .. code-tab:: gdscript GDScript
 
-    st.add_normal() # Overwritten by normal below.
-    st.add_normal() # Added to next vertex.
-    st.add_color() # Added to next vertex.
+    st.set_normal() # Overwritten by normal below.
+    st.set_normal() # Added to next vertex.
+    st.set_color() # Added to next vertex.
     st.add_vertex() # Captures normal and color above.
-    st.add_normal() # Normal never added to a vertex.
+    st.set_normal() # Normal never added to a vertex.
 
 When finished generating your geometry with the :ref:`SurfaceTool <class_surfacetool>`
 call ``commit()`` to finish generating the mesh. If an :ref:`ArrayMesh <class_ArrayMesh>` is passed
@@ -43,17 +43,17 @@ Code creates a triangle with indices
     st.begin(Mesh.PRIMITIVE_TRIANGLES)
 
     # Prepare attributes for add_vertex.
-    st.add_normal(Vector3(0, 0, 1))
-    st.add_uv(Vector2(0, 0))
+    st.set_normal(Vector3(0, 0, 1))
+    st.set_uv(Vector2(0, 0))
     # Call last for each vertex, adds the above attributes.
     st.add_vertex(Vector3(-1, -1, 0))
 
-    st.add_normal(Vector3(0, 0, 1))
-    st.add_uv(Vector2(0, 1))
+    st.set_normal(Vector3(0, 0, 1))
+    st.set_uv(Vector2(0, 1))
     st.add_vertex(Vector3(-1, 1, 0))
 
-    st.add_normal(Vector3(0, 0, 1))
-    st.add_uv(Vector2(1, 1))
+    st.set_normal(Vector3(0, 0, 1))
+    st.set_uv(Vector2(1, 1))
     st.add_vertex(Vector3(1, 1, 0))
 
     # Commit to a mesh.