classref: Sync with current master branch (bdf625b)

This commit is contained in:
Godot Organization
2025-01-04 03:20:59 +00:00
parent cb6eb02112
commit eab235f772
37 changed files with 496 additions and 345 deletions

View File

@@ -30,7 +30,7 @@ Description
func test():
var callable = Callable(self, "print_args")
callable.call("hello", "world") # Prints "hello world ".
callable.call(Vector2.UP, 42, callable) # Prints "(0.0, -1.0) 42 Node(node.gd)::print_args".
callable.call(Vector2.UP, 42, callable) # Prints "(0.0, -1.0) 42 Node(node.gd)::print_args"
callable.call("invalid") # Invalid call, should have at least 2 arguments.
.. code-tab:: csharp
@@ -46,7 +46,7 @@ Description
// 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(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs"
callable.Call("invalid"); // Invalid call, should have 3 arguments.
}
@@ -60,7 +60,7 @@ In GDScript, it's possible to create lambda functions within a method. Lambda fu
var my_lambda = func (message):
print(message)
# Prints Hello everyone!
# Prints "Hello everyone!"
my_lambda.call("Hello everyone!")
# Prints "Attack!", when the button_pressed signal is emitted.