Change example used for StringName call methods
Co-authored-by: Raul Santos <raulsntos@gmail.com>
This commit is contained in:
parent
5f69218edc
commit
b587c77cb2
@ -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:
|
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]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
var node = Node2D.new()
|
var node = Node3D.new()
|
||||||
node.call("set", "position", Vector2(42, 0))
|
node.call("rotate", Vector3(1.0, 0.0, 0.0), 1.571)
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
var node = new Node2D();
|
var node = new Node3D();
|
||||||
node.Call("set", "position", new Vector2(42, 0));
|
node.Call("rotate", new Vector3(1f, 0f, 0f), 1.571f);
|
||||||
[/csharp]
|
[/csharp]
|
||||||
[/codeblocks]
|
[/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).
|
[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:
|
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]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
var node = Node2D.new()
|
var node = Node3D.new()
|
||||||
node.call_deferred("set", "position", Vector2(42, 0))
|
node.call_deferred("rotate", Vector3(1.0, 0.0, 0.0), 1.571)
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
var node = new Node2D();
|
var node = new Node3D();
|
||||||
node.CallDeferred("set", "position", new Vector2(42, 0));
|
node.CallDeferred("rotate", new Vector3(1f, 0f, 0f), 1.571f);
|
||||||
[/csharp]
|
[/csharp]
|
||||||
[/codeblocks]
|
[/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).
|
[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].
|
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]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
var node = Node2D.new()
|
var node = Node3D.new()
|
||||||
node.callv("set", ["position", Vector2(42, 0)])
|
node.callv("rotate", [Vector3(1.0, 0.0, 0.0), 1.571])
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
var node = new Node2D();
|
var node = new Node3D();
|
||||||
node.Callv("set", new Godot.Collections.Array { "position", new Vector2(42, 0) });
|
node.Callv("rotate", new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f });
|
||||||
[/csharp]
|
[/csharp]
|
||||||
[/codeblocks]
|
[/codeblocks]
|
||||||
</description>
|
</description>
|
||||||
|
Loading…
Reference in New Issue
Block a user