diff options
Diffstat (limited to 'doc/classes/Callable.xml')
-rw-r--r-- | doc/classes/Callable.xml | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 5c845ba57e..8fc44d7536 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -14,21 +14,23 @@ func test(): var callable = Callable(self, "print_args") callable.call("hello", "world") # Prints "hello world ". - callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(Node.gd)::print_args". + callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(node.gd)::print_args". callable.call("invalid") # Invalid call, should have at least 2 arguments. [/gdscript] [csharp] - public void PrintArgs(object arg1, object arg2, object arg3 = null) + // Default parameter values are not supported. + public void PrintArgs(Variant arg1, Variant arg2, Variant arg3 = default) { GD.PrintS(arg1, arg2, arg3); } public void Test() { - Callable callable = new Callable(this, nameof(PrintArgs)); - callable.Call("hello", "world"); // Prints "hello world null". + // Invalid calls fail silently. + Callable callable = new Callable(this, MethodName.PrintArgs); + callable.Call("hello", "world"); // Default parameter values are not supported, should have 3 arguments. callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs". - callable.Call("invalid"); // Invalid call, should have at least 2 arguments. + callable.Call("invalid"); // Invalid call, should have 3 arguments. } [/csharp] [/codeblocks] @@ -107,6 +109,18 @@ Calls the method represented by this [Callable]. Unlike [method call], this method expects all arguments to be contained inside the [param arguments] [Array]. </description> </method> + <method name="get_bound_arguments" qualifiers="const"> + <return type="Array" /> + <description> + Return the bound arguments (as long as [method get_bound_arguments_count] is greater than zero), or empty (if [method get_bound_arguments_count] is less than or equal to zero). + </description> + </method> + <method name="get_bound_arguments_count" qualifiers="const"> + <return type="int" /> + <description> + Returns the total amount of arguments bound (or unbound) via successive [method bind] or [method unbind] calls. If the amount of arguments unbound is greater than the ones bound, this function returns a value less than zero. + </description> + </method> <method name="get_method" qualifiers="const"> <return type="StringName" /> <description> |