Merge pull request #44914 from swarnimarun/master-visualscript-refactor
Fix doc for the VisualScript class after #39649 PR
This commit is contained in:
commit
0b49e5de12
2 changed files with 55 additions and 83 deletions
|
@ -26,23 +26,23 @@
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="name" type="StringName">
|
<argument index="0" name="name" type="StringName">
|
||||||
</argument>
|
</argument>
|
||||||
|
<argument index="1" name="func_node_id" type="int">
|
||||||
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Add a function with the specified name to the VisualScript.
|
Add a function with the specified name to the VisualScript, and assign the root [VisualScriptFunction] node's id as [code]func_node_id[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="add_node">
|
<method name="add_node">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="id" type="int">
|
<argument index="1" name="node" type="VisualScriptNode">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="node" type="VisualScriptNode">
|
<argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
|
||||||
</argument>
|
|
||||||
<argument index="3" name="position" type="Vector2" default="Vector2( 0, 0 )">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Add a node to a function of the VisualScript.
|
Add a node to the VisualScript.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="add_variable">
|
<method name="add_variable">
|
||||||
|
@ -157,15 +157,13 @@
|
||||||
<method name="data_connect">
|
<method name="data_connect">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="from_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="from_node" type="int">
|
<argument index="1" name="from_port" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="from_port" type="int">
|
<argument index="2" name="to_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="3" name="to_node" type="int">
|
<argument index="3" name="to_port" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="4" name="to_port" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Connect two data ports. The value of [code]from_node[/code]'s [code]from_port[/code] would be fed into [code]to_node[/code]'s [code]to_port[/code].
|
Connect two data ports. The value of [code]from_node[/code]'s [code]from_port[/code] would be fed into [code]to_node[/code]'s [code]to_port[/code].
|
||||||
|
@ -174,15 +172,13 @@
|
||||||
<method name="data_disconnect">
|
<method name="data_disconnect">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="from_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="from_node" type="int">
|
<argument index="1" name="from_port" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="from_port" type="int">
|
<argument index="2" name="to_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="3" name="to_node" type="int">
|
<argument index="3" name="to_port" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="4" name="to_port" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Disconnect two data ports previously connected with [method data_connect].
|
Disconnect two data ports previously connected with [method data_connect].
|
||||||
|
@ -197,37 +193,31 @@
|
||||||
Returns the id of a function's entry point node.
|
Returns the id of a function's entry point node.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_function_scroll" qualifiers="const">
|
|
||||||
<return type="Vector2">
|
|
||||||
</return>
|
|
||||||
<argument index="0" name="name" type="StringName">
|
|
||||||
</argument>
|
|
||||||
<description>
|
|
||||||
Returns the position of the center of the screen for a given function.
|
|
||||||
</description>
|
|
||||||
</method>
|
|
||||||
<method name="get_node" qualifiers="const">
|
<method name="get_node" qualifiers="const">
|
||||||
<return type="VisualScriptNode">
|
<return type="VisualScriptNode">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="1" name="id" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Returns a node given its id and its function.
|
Returns a node given its id.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_node_position" qualifiers="const">
|
<method name="get_node_position" qualifiers="const">
|
||||||
<return type="Vector2">
|
<return type="Vector2">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="1" name="id" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Returns a node's position in pixels.
|
Returns a node's position in pixels.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="get_scroll" qualifiers="const">
|
||||||
|
<return type="Vector2">
|
||||||
|
</return>
|
||||||
|
<description>
|
||||||
|
Returns the current position of the center of the screen.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="get_variable_default_value" qualifiers="const">
|
<method name="get_variable_default_value" qualifiers="const">
|
||||||
<return type="Variant">
|
<return type="Variant">
|
||||||
</return>
|
</return>
|
||||||
|
@ -267,15 +257,13 @@
|
||||||
<method name="has_data_connection" qualifiers="const">
|
<method name="has_data_connection" qualifiers="const">
|
||||||
<return type="bool">
|
<return type="bool">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="from_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="from_node" type="int">
|
<argument index="1" name="from_port" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="from_port" type="int">
|
<argument index="2" name="to_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="3" name="to_node" type="int">
|
<argument index="3" name="to_port" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="4" name="to_port" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Returns whether the specified data ports are connected.
|
Returns whether the specified data ports are connected.
|
||||||
|
@ -293,9 +281,7 @@
|
||||||
<method name="has_node" qualifiers="const">
|
<method name="has_node" qualifiers="const">
|
||||||
<return type="bool">
|
<return type="bool">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="1" name="id" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Returns whether a node exists with the given id.
|
Returns whether a node exists with the given id.
|
||||||
|
@ -304,13 +290,11 @@
|
||||||
<method name="has_sequence_connection" qualifiers="const">
|
<method name="has_sequence_connection" qualifiers="const">
|
||||||
<return type="bool">
|
<return type="bool">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="from_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="from_node" type="int">
|
<argument index="1" name="from_output" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="from_output" type="int">
|
<argument index="2" name="to_node" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="3" name="to_node" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Returns whether the specified sequence ports are connected.
|
Returns whether the specified sequence ports are connected.
|
||||||
|
@ -346,12 +330,10 @@
|
||||||
<method name="remove_node">
|
<method name="remove_node">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="1" name="id" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Remove a specific node.
|
Remove the node with the specified id.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="remove_variable">
|
<method name="remove_variable">
|
||||||
|
@ -399,13 +381,11 @@
|
||||||
<method name="sequence_connect">
|
<method name="sequence_connect">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="from_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="from_node" type="int">
|
<argument index="1" name="from_output" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="from_output" type="int">
|
<argument index="2" name="to_node" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="3" name="to_node" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Connect two sequence ports. The execution will flow from of [code]from_node[/code]'s [code]from_output[/code] into [code]to_node[/code].
|
Connect two sequence ports. The execution will flow from of [code]from_node[/code]'s [code]from_output[/code] into [code]to_node[/code].
|
||||||
|
@ -415,29 +395,16 @@
|
||||||
<method name="sequence_disconnect">
|
<method name="sequence_disconnect">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="from_node" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="from_node" type="int">
|
<argument index="1" name="from_output" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="2" name="from_output" type="int">
|
<argument index="2" name="to_node" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="3" name="to_node" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Disconnect two sequence ports previously connected with [method sequence_connect].
|
Disconnect two sequence ports previously connected with [method sequence_connect].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_function_scroll">
|
|
||||||
<return type="void">
|
|
||||||
</return>
|
|
||||||
<argument index="0" name="name" type="StringName">
|
|
||||||
</argument>
|
|
||||||
<argument index="1" name="ofs" type="Vector2">
|
|
||||||
</argument>
|
|
||||||
<description>
|
|
||||||
Position the center of the screen for a function.
|
|
||||||
</description>
|
|
||||||
</method>
|
|
||||||
<method name="set_instance_base_type">
|
<method name="set_instance_base_type">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
|
@ -450,14 +417,21 @@
|
||||||
<method name="set_node_position">
|
<method name="set_node_position">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="func" type="StringName">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<argument index="1" name="id" type="int">
|
<argument index="1" name="position" type="Vector2">
|
||||||
</argument>
|
|
||||||
<argument index="2" name="position" type="Vector2">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Position a node on the screen.
|
Set the node position in the VisualScript graph.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
|
<method name="set_scroll">
|
||||||
|
<return type="void">
|
||||||
|
</return>
|
||||||
|
<argument index="0" name="ofs" type="Vector2">
|
||||||
|
</argument>
|
||||||
|
<description>
|
||||||
|
Set the screen center to the given position.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_variable_default_value">
|
<method name="set_variable_default_value">
|
||||||
|
@ -496,9 +470,7 @@
|
||||||
</methods>
|
</methods>
|
||||||
<signals>
|
<signals>
|
||||||
<signal name="node_ports_changed">
|
<signal name="node_ports_changed">
|
||||||
<argument index="0" name="function" type="String">
|
<argument index="0" name="id" type="int">
|
||||||
</argument>
|
|
||||||
<argument index="1" name="id" type="int">
|
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Emitted when the ports of a node are changed.
|
Emitted when the ports of a node are changed.
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ Dictionary VisualScript::_get_data() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualScript::_bind_methods() {
|
void VisualScript::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("add_function", "name"), &VisualScript::add_function);
|
ClassDB::bind_method(D_METHOD("add_function", "name", "func_node_id"), &VisualScript::add_function);
|
||||||
ClassDB::bind_method(D_METHOD("has_function", "name"), &VisualScript::has_function);
|
ClassDB::bind_method(D_METHOD("has_function", "name"), &VisualScript::has_function);
|
||||||
ClassDB::bind_method(D_METHOD("remove_function", "name"), &VisualScript::remove_function);
|
ClassDB::bind_method(D_METHOD("remove_function", "name"), &VisualScript::remove_function);
|
||||||
ClassDB::bind_method(D_METHOD("rename_function", "name", "new_name"), &VisualScript::rename_function);
|
ClassDB::bind_method(D_METHOD("rename_function", "name", "new_name"), &VisualScript::rename_function);
|
||||||
|
|
Loading…
Reference in a new issue