소스 검색

Clarified statement

Previously, the section on ADD_SIGNAL was a little convoluted and not entirely correct. I've fixed mild grammatical issues and expanded on it for new programmers, addressing these issues.
Michael Macha 2 년 전
부모
커밋
b8830332a5
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      tutorials/scripting/gdextension/gdextension_cpp_example.rst

+ 9 - 3
tutorials/scripting/gdextension/gdextension_cpp_example.rst

@@ -584,9 +584,15 @@ as follows:
         ADD_SIGNAL(MethodInfo("position_changed", PropertyInfo(Variant::OBJECT, "node"), PropertyInfo(Variant::VECTOR2, "new_pos")));
         ADD_SIGNAL(MethodInfo("position_changed", PropertyInfo(Variant::OBJECT, "node"), PropertyInfo(Variant::VECTOR2, "new_pos")));
     }
     }
 
 
-Here, our ``ADD_SIGNAL`` macro can be a single call first taking the
-signals name, then having pairs of the type specifying the parameter name and
-the value of each parameter we'll send along with this signal.
+Here, our ``ADD_SIGNAL`` macro can be a single call with a ``MethodInfo`` argument.
+``MethodInfo``'s first parameter will be the signal's name, and its remaining parameters
+are ``PropertyInfo`` types which describe the essentials of each of the method's parameters.
+``PropertyInfo`` parameters are defined with the data type of the parameter, and then the name
+that the parameter will have by default.
+
+So here, we add a signal, with a ``MethodInfo`` which names the signal "position_changed". The
+``PropertyInfo`` parameters describe two esential arguments, one of type ``Object``, the other
+of type ``Vector2``, respectively named "node" and "new_pos".
 
 
 Next, we'll need to change our ``_process`` method:
 Next, we'll need to change our ``_process`` method: