summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2021-09-13 02:57:21 +0200
committerGitHub <noreply@github.com>2021-09-13 02:57:21 +0200
commit9d4c84e1548edad3aa66fb11c8e948295e7b656e (patch)
treeefdf0f4c9802cbe5144ae20a2baced567839f785 /doc
parentcc0ab8fb2db4223763c1bd01b0816bbcb2bb7b96 (diff)
parentb587c77cb23cdd00e913e0fae95dbfc9f1198548 (diff)
Merge pull request #52587 from zacryol/call_example_change
Change example used for StringName call methods
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/Object.xml24
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index 57b5de7c76..ed045f8390 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -92,12 +92,12 @@
Calls the [code]method[/code] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
[codeblocks]
[gdscript]
- var node = Node2D.new()
- node.call("set", "position", Vector2(42, 0))
+ var node = Node3D.new()
+ node.call("rotate", Vector3(1.0, 0.0, 0.0), 1.571)
[/gdscript]
[csharp]
- var node = new Node2D();
- node.Call("set", "position", new Vector2(42, 0));
+ var node = new Node3D();
+ node.Call("rotate", new Vector3(1f, 0f, 0f), 1.571f);
[/csharp]
[/codeblocks]
[b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
@@ -110,12 +110,12 @@
Calls the [code]method[/code] on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
[codeblocks]
[gdscript]
- var node = Node2D.new()
- node.call_deferred("set", "position", Vector2(42, 0))
+ var node = Node3D.new()
+ node.call_deferred("rotate", Vector3(1.0, 0.0, 0.0), 1.571)
[/gdscript]
[csharp]
- var node = new Node2D();
- node.CallDeferred("set", "position", new Vector2(42, 0));
+ var node = new Node3D();
+ node.CallDeferred("rotate", new Vector3(1f, 0f, 0f), 1.571f);
[/csharp]
[/codeblocks]
[b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
@@ -129,12 +129,12 @@
Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expects all parameters to be via a single [Array].
[codeblocks]
[gdscript]
- var node = Node2D.new()
- node.callv("set", ["position", Vector2(42, 0)])
+ var node = Node3D.new()
+ node.callv("rotate", [Vector3(1.0, 0.0, 0.0), 1.571])
[/gdscript]
[csharp]
- var node = new Node2D();
- node.Callv("set", new Godot.Collections.Array { "position", new Vector2(42, 0) });
+ var node = new Node3D();
+ node.Callv("rotate", new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f });
[/csharp]
[/codeblocks]
</description>